@dss-kit/ui-kit 0.2.31 → 0.2.33

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (98) hide show
  1. package/README.md +21 -21
  2. package/dist/components/builders/Loader/Loader.d.ts +2 -0
  3. package/dist/components/builders/Loader/Loader.d.ts.map +1 -1
  4. package/dist/components/builders/Modal/Modal.d.ts +3 -0
  5. package/dist/components/builders/Modal/Modal.d.ts.map +1 -1
  6. package/dist/components/builders/Modal/ModalHeader/ModalHeader.d.ts +8 -0
  7. package/dist/components/builders/Modal/ModalHeader/ModalHeader.d.ts.map +1 -1
  8. package/dist/components/builders/Table/Table.d.ts +1 -1
  9. package/dist/components/builders/Table/Table.d.ts.map +1 -1
  10. package/dist/components/builders/Table/Table.stories.d.ts.map +1 -1
  11. package/dist/components/builders/Table/Table.types.d.ts +20 -1
  12. package/dist/components/builders/Table/Table.types.d.ts.map +1 -1
  13. package/dist/components/builders/Table/TableHeadCellContent/TableHeadCellContent.d.ts.map +1 -1
  14. package/dist/components/builders/Table/TablePagination/TablePagination.d.ts +28 -0
  15. package/dist/components/builders/Table/TablePagination/TablePagination.d.ts.map +1 -1
  16. package/dist/components/builders/Table/TablePagination/index.d.ts +1 -1
  17. package/dist/components/builders/Table/TablePagination/index.d.ts.map +1 -1
  18. package/dist/components/builders/Table/TableWrapper/TableWrapper.d.ts +3 -1
  19. package/dist/components/builders/Table/TableWrapper/TableWrapper.d.ts.map +1 -1
  20. package/dist/components/charts/LineChart/LineChart.d.ts.map +1 -1
  21. package/dist/components/charts/PieProgressChart/PieProgressChart.d.ts.map +1 -1
  22. package/dist/components/controls/Button/Button.d.ts +9 -0
  23. package/dist/components/controls/Button/Button.d.ts.map +1 -1
  24. package/dist/components/controls/Checkbox/Checkbox.d.ts +10 -0
  25. package/dist/components/controls/Checkbox/Checkbox.d.ts.map +1 -1
  26. package/dist/components/controls/IconButton/IconButton.stories.d.ts +1 -0
  27. package/dist/components/controls/IconButton/IconButton.stories.d.ts.map +1 -1
  28. package/dist/components/controls/Input/Input.d.ts +15 -2
  29. package/dist/components/controls/Input/Input.d.ts.map +1 -1
  30. package/dist/components/controls/Input/Input.stories.d.ts.map +1 -1
  31. package/dist/components/controls/MarkdownTextEditor/MarkdownTextEditor.d.ts +1 -1
  32. package/dist/components/controls/MarkdownTextEditor/MarkdownTextEditor.d.ts.map +1 -1
  33. package/dist/components/controls/MarkdownTextEditor/MarkdownTextEditor.types.d.ts +12 -0
  34. package/dist/components/controls/MarkdownTextEditor/MarkdownTextEditor.types.d.ts.map +1 -1
  35. package/dist/components/controls/MarkdownTextEditor/components/EditorToolbar/EditorToolbar.d.ts +1 -1
  36. package/dist/components/controls/MarkdownTextEditor/components/EditorToolbar/EditorToolbar.d.ts.map +1 -1
  37. package/dist/components/controls/MarkdownTextEditor/components/EditorToolbar/EditorToolbar.types.d.ts +2 -0
  38. package/dist/components/controls/MarkdownTextEditor/components/EditorToolbar/EditorToolbar.types.d.ts.map +1 -1
  39. package/dist/components/controls/MarkdownTextEditor/components/MarkdownField/MarkdownField.types.d.ts +2 -0
  40. package/dist/components/controls/MarkdownTextEditor/components/MarkdownField/MarkdownField.types.d.ts.map +1 -1
  41. package/dist/components/controls/MarkdownTextEditor/components/MarkdownPreview/MarkdownPreview.d.ts +8 -1
  42. package/dist/components/controls/MarkdownTextEditor/components/MarkdownPreview/MarkdownPreview.d.ts.map +1 -1
  43. package/dist/components/controls/OtpInput/OtpInput.d.ts +10 -0
  44. package/dist/components/controls/OtpInput/OtpInput.d.ts.map +1 -1
  45. package/dist/components/controls/RadioGroup/Radio.d.ts +10 -0
  46. package/dist/components/controls/RadioGroup/Radio.d.ts.map +1 -1
  47. package/dist/components/controls/RadioGroup/RadioGroup.d.ts +4 -0
  48. package/dist/components/controls/RadioGroup/RadioGroup.d.ts.map +1 -1
  49. package/dist/components/controls/SegmentControl/SegmentControl.d.ts +13 -1
  50. package/dist/components/controls/SegmentControl/SegmentControl.d.ts.map +1 -1
  51. package/dist/components/controls/Select/Select.d.ts +15 -1
  52. package/dist/components/controls/Select/Select.d.ts.map +1 -1
  53. package/dist/components/controls/Switch/Switch.d.ts +16 -0
  54. package/dist/components/controls/Switch/Switch.d.ts.map +1 -1
  55. package/dist/components/controls/Tabs/TabItem/TabItem.d.ts +6 -0
  56. package/dist/components/controls/Tabs/TabItem/TabItem.d.ts.map +1 -1
  57. package/dist/components/controls/Tabs/Tabs.d.ts +9 -1
  58. package/dist/components/controls/Tabs/Tabs.d.ts.map +1 -1
  59. package/dist/components/navigation/Breadcrumbs/Breadcrumbs.d.ts +6 -0
  60. package/dist/components/navigation/Breadcrumbs/Breadcrumbs.d.ts.map +1 -1
  61. package/dist/components/shared/Badge/Badge.d.ts +4 -0
  62. package/dist/components/shared/Badge/Badge.d.ts.map +1 -1
  63. package/dist/components/shared/Hint/Hint.d.ts +8 -0
  64. package/dist/components/shared/Hint/Hint.d.ts.map +1 -1
  65. package/dist/components/shared/MarkdownText/MarkdownText.d.ts +3 -1
  66. package/dist/components/shared/MarkdownText/MarkdownText.d.ts.map +1 -1
  67. package/dist/components/shared/Popover/Popover.d.ts +2 -0
  68. package/dist/components/shared/Popover/Popover.d.ts.map +1 -1
  69. package/dist/components/shared/Skeleton/Skeleton.d.ts +5 -0
  70. package/dist/components/shared/Skeleton/Skeleton.d.ts.map +1 -1
  71. package/dist/components/shared/Tag/Tag.d.ts +8 -0
  72. package/dist/components/shared/Tag/Tag.d.ts.map +1 -1
  73. package/dist/components/shared/Toast/Toast.d.ts +10 -0
  74. package/dist/components/shared/Toast/Toast.d.ts.map +1 -1
  75. package/dist/components/shared/Toast/ToastContainer.d.ts +7 -1
  76. package/dist/components/shared/Toast/ToastContainer.d.ts.map +1 -1
  77. package/dist/components/shared/Tooltip/Tooltip.d.ts +4 -0
  78. package/dist/components/shared/Tooltip/Tooltip.d.ts.map +1 -1
  79. package/dist/styles/utils/breakpoints/base.scss +11 -11
  80. package/dist/styles/utils/breakpoints/index.scss +3 -3
  81. package/dist/styles/utils/breakpoints/screen.scss +61 -61
  82. package/dist/styles/utils/breakpoints/semantic.scss +31 -31
  83. package/dist/styles/utils/breakpoints.ts +35 -35
  84. package/dist/styles/utils/fonts/font-family.scss +3 -3
  85. package/dist/styles/utils/fonts/index.scss +1 -1
  86. package/dist/styles/utils/index.scss +5 -5
  87. package/dist/styles/utils/size/index.scss +1 -1
  88. package/dist/styles/utils/size/modifiers.scss +40 -40
  89. package/dist/styles/utils/style/index.scss +1 -1
  90. package/dist/styles/utils/style/variants.scss +34 -34
  91. package/dist/styles/utils/typography/_font-weight.scss +33 -33
  92. package/dist/styles/utils/typography/_variants.scss +85 -85
  93. package/dist/styles/utils/typography/index.scss +2 -2
  94. package/dist/ui-kit.cjs.js +46 -46
  95. package/dist/ui-kit.cjs.js.map +1 -1
  96. package/dist/ui-kit.es.js +11536 -11045
  97. package/dist/ui-kit.es.js.map +1 -1
  98. package/package.json +92 -92
@@ -1,11 +1,11 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const C=require("react/jsx-runtime"),S=require("react"),R=require("@emotion/css"),Rs=require("react-dom"),il=require("@highcharts/react");function L0(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const M=L0(S),T_=L0(Rs);function E_(e){const{h:t,w:n,m:r,mx:o,my:i,mt:s,mr:a,mb:l,ml:c,p:u,px:f,py:d,pt:h,pr:g,pb:p,pl:m,gap:x,xGap:y,yGap:v,row:b,flex:w,relative:_,absolute:E,display:T,overflow:k,absoluteFill:P,center:O,justifyContent:D,alignItems:I,alignSelf:$,borderWidth:H,borderBottomWidth:U,borderColor:L,borderRadius:N,borderStyle:V,border:K,zIndex:te,minWidth:J,minHeight:Z,maxWidth:ae,maxHeight:oe,flexWrap:fe,flexGrow:Te,flexShrink:ne,flexBasis:ve,backgroundColor:Ee,position:De,top:st,right:ee,bottom:Ce,left:ze,cursor:Re,...mt}=e;return{spacers:{h:t,w:n,m:r,mx:o,my:i,mt:s,mr:a,mb:l,ml:c,p:u,px:f,py:d,pt:h,pr:g,pb:p,pl:m,gap:x,xGap:y,yGap:v,row:b,flex:w,relative:_,absolute:E,display:T,overflow:k,absoluteFill:P,center:O,justifyContent:D,alignItems:I,alignSelf:$,borderWidth:H,borderBottomWidth:U,borderColor:L,borderRadius:N,borderStyle:V,border:K,zIndex:te,minWidth:J,minHeight:Z,maxWidth:ae,maxHeight:oe,flexWrap:fe,flexGrow:Te,flexShrink:ne,flexBasis:ve,backgroundColor:Ee,position:De,top:st,right:ee,bottom:Ce,left:ze,cursor:Re},rest:mt}}const R_=e=>R.css({display:e.display??"flex",flexDirection:e.row?"row":"column",height:e.h==="screen"?"100vh":e.h==="full"?"100%":e.h,width:e.w==="screen"?"100vw":e.w==="full"?"100%":e.w,margin:e.m,marginTop:e.mt??e.my,marginBottom:e.mb??e.my,marginLeft:e.ml??e.mx,marginRight:e.mr??e.mx,padding:e.p,paddingTop:e.pt??e.py,paddingBottom:e.pb??e.py,paddingLeft:e.pl??e.px,paddingRight:e.pr??e.px,gap:e.gap,columnGap:e.xGap,rowGap:e.yGap,justifyContent:e.center?"center":e.justifyContent,alignItems:e.center?"center":e.alignItems,alignSelf:e.alignSelf,borderWidth:e.borderWidth,borderBottomWidth:e.borderBottomWidth,borderColor:e.borderColor,borderRadius:e.borderRadius,borderStyle:e.borderStyle,border:e.border,zIndex:e.zIndex,overflow:e.overflow,minWidth:e.minWidth,minHeight:e.minHeight,maxWidth:e.maxWidth,maxHeight:e.maxHeight,flex:e.flex===!0?1:e.flex,flexWrap:e.flexWrap,flexGrow:e.flexGrow,flexShrink:e.flexShrink,flexBasis:e.flexBasis,backgroundColor:e.backgroundColor,position:e?.position?e?.position:e?.absolute?"absolute":e?.relative?"relative":void 0,...e.absoluteFill&&{position:"absolute",top:0,right:0,bottom:0,left:0},top:e?.top,right:e?.right,bottom:e?.bottom,left:e?.left,cursor:e.cursor}),G=S.forwardRef(({className:e,children:t,...n},r)=>{const{spacers:o,rest:i}=E_(n),s=S.useMemo(()=>R_(o),[o]);return C.jsx("div",{ref:r,className:R.cx(s,e),...i,children:t})});G.displayName="Box";var lo=(e=>(e[e._1920=1920]="_1920",e[e._1440=1440]="_1440",e[e._1280=1280]="_1280",e[e._1200=1200]="_1200",e[e._1024=1024]="_1024",e[e._992=992]="_992",e[e._768=768]="_768",e[e._576=576]="_576",e[e._480=480]="_480",e[e._375=375]="_375",e))(lo||{});const Er={xs:480,sm:576,md:768,lg:992,xl:1200},k_=e=>{const{direction:t="max"}=e||{},[n,r]=S.useState(typeof window<"u"?window.innerWidth:Er.xl);S.useEffect(()=>{if(typeof window>"u")return;const i=()=>r(window.innerWidth);return window.addEventListener("resize",i),()=>window.removeEventListener("resize",i)},[]);const o=S.useCallback(i=>{const s=Er[i];return t==="min"?n>=s:n<s},[n,t]);return{windowWidth:n,match:o,isXs:o("xs"),isSm:o("sm"),isMd:o("md"),isLg:o("lg"),isXl:o("xl")}};function Fo(e,t){const{current:n}=S.useRef(e!==void 0),[r,o]=S.useState(t),i=n?e:r,s=S.useCallback(a=>{n||o(a)},[]);return[i,s]}function Sf(e,t,n,r=""){if(n)return e[`${t}_${n}${r}`]}function A_(e,t,n){return Sf(e,t,n,"Weight")}function M_(e,t,n){return Sf(e,t,n,"Size")}const N_={border:{accentPrimary:"var(--border-accent-primary)",accentPrimaryHover:"var(--border-accent-primary-hover)",accentSecondary:"var(--border-accent-secondary)",accentSecondaryHover:"var(--border-accent-secondary-hover)",negativePrimary:"var(--border-negative-primary)",negativePrimaryHover:"var(--border-negative-primary-hover)",negativeSecondary:"var(--border-negative-secondary)",negativeSecondaryHover:"var(--border-negative-secondary-hover)",positivePrimary:"var(--border-positive-primary)",positivePrimaryHover:"var(--border-positive-primary-hover)",positiveSecondary:"var(--border-positive-secondary)",positiveSecondaryHover:"var(--border-positive-secondary-hover)",warningPrimary:"var(--border-warning-primary)",warningPrimaryHover:"var(--border-warning-primary-hover)",warningSecondary:"var(--border-warning-secondary)",warningSecondaryHover:"var(--border-warning-secondary-hover)",neutralPrimary:"var(--border-neutral-primary)",neutralPrimaryHover:"var(--border-neutral-primary-hover)",neutralAlphaBasic:"var(--border-neutral-alpha-basic)",neutralAlphaLow:"var(--border-neutral-alpha-low)",neutralAlphaHigh:"var(--border-neutral-alpha-high)",transferPrimary:"var(--border-transfer-primary)",transferPrimaryHover:"var(--border-transfer-primary-hover)",transferSecondary:"var(--border-transfer-secondary)",transferSecondaryHover:"var(--border-transfer-secondary-hover)"},text:{primary:"var(--text-primary)",primaryInverse:"var(--text-primary-inverse)",primaryHover:"var(--text-primary-hover)",secondary:"var(--text-secondary)",secondaryInverse:"var(--text-secondary-inverse)",secondaryHover:"var(--text-secondary-hover)",tertiary:"var(--text-tertiary)",tertiaryInverse:"var(--text-tertiary-inverse)",tertiaryHover:"var(--text-tertiary-hover)",positive:"var(--text-positive)",positiveHover:"var(--text-positive-hover)",negative:"var(--text-negative)",negativeHover:"var(--text-negative-hover)",warning:"var(--text-warning)",warningHover:"var(--text-warning-hover)",accent:"var(--text-accent)",accentHover:"var(--text-accent-hover)",inverse:"var(--text-inverse)",transfer:"var(--text-transfer)",transferHover:"var(--text-transfer-hover)"},icon:{primary:"var(--icon-primary)",primaryHover:"var(--icon-primary-hover)",primaryInverse:"var(--icon-primary-inverse)",secondary:"var(--icon-secondary)",secondaryHover:"var(--icon-secondary-hover)",tertiary:"var(--icon-tertiary)",tertiaryInverse:"var(--icon-tertiary-inverse)",tertiaryHover:"var(--icon-tertiary-hover)",positive:"var(--icon-positive)",positiveHover:"var(--icon-positive-hover)",negative:"var(--icon-negative)",negativeHover:"var(--icon-negative-hover)",warning:"var(--icon-warning)",warningHover:"var(--icon-warning-hover)",accent:"var(--icon-accent)",accentHover:"var(--icon-accent-hover)",inverse:"var(--icon-inverse)",transfer:"var(--icon-transfer)",transferHover:"var(--icon-transfer-hover)"},fill:{accentPrimary:"var(--fill-accent-primary)",accentPrimaryHover:"var(--fill-accent-primary-hover)",accentSecondary:"var(--fill-accent-secondary)",accentSecondaryHover:"var(--fill-accent-secondary-hover)",accentTintHigh:"var(--fill-accent-tint-high)",accentTint:"var(--fill-accent-tint)",accentTintLow:"var(--fill-accent-tint-low)",accentTransparent:"var(--fill-accent-transparent)",positivePrimary:"var(--fill-positive-primary)",positivePrimaryHover:"var(--fill-positive-primary-hover)",positiveSecondary:"var(--fill-positive-secondary)",positiveSecondaryHover:"var(--fill-positive-secondary-hover)",positiveTintHigh:"var(--fill-positive-tint-high)",positiveTint:"var(--fill-positive-tint)",positiveTintLow:"var(--fill-positive-tint-low)",positiveTransparent:"var(--fill-positive-transparent)",negativePrimary:"var(--fill-negative-primary)",negativePrimaryHover:"var(--fill-negative-primary-hover)",negativeSecondary:"var(--fill-negative-secondary)",negativeSecondaryHover:"var(--fill-negative-secondary-hover)",negativeTintHigh:"var(--fill-negative-tint-high)",negativeTint:"var(--fill-negative-tint)",negativeTintLow:"var(--fill-negative-tint-low)",negativeTransparent:"var(--fill-negative-transparent)",warningPrimary:"var(--fill-warning-primary)",warningPrimaryHover:"var(--fill-warning-primary-hover)",warningSecondary:"var(--fill-warning-secondary)",warningSecondaryHover:"var(--fill-warning-secondary-hover)",warningTintHigh:"var(--fill-warning-tint-high)",warningTint:"var(--fill-warning-tint)",warningTintLow:"var(--fill-warning-tint-low)",warningTransparent:"var(--fill-warning-transparent)",neutralPrimary:"var(--fill-neutral-primary)",neutralPrimaryHover:"var(--fill-neutral-primary-hover)",neutralSecondary:"var(--fill-neutral-secondary)",neutralSecondaryInverse:"var(--fill-neutral-secondary-inverse)",neutralSecondaryHover:"var(--fill-neutral-secondary-hover)",neutralTint:"var(--fill-neutral-tint)",neutralTintLow:"var(--fill-neutral-tint-low)",transferPrimary:"var(--fill-transfer-primary)",transferPrimaryHover:"var(--fill-transfer-primary-hover)",transferSecondary:"var(--fill-transfer-secondary)",transferSecondaryHover:"var(--fill-transfer-secondary-hover)",transferTintHigh:"var(--fill-transfer-tint-high)",transferTint:"var(--fill-transfer-tint)",transferTintLow:"var(--fill-transfer-tint-low)",transferTransparent:"var(--fill-transfer-transparent)",bgPrimary:"var(--fill-bg-primary)",bgPrimaryInverse:"var(--fill-bg-primary-inverse)",bgSecondary:"var(--fill-bg-secondary)",bgSecondaryInverse:"var(--fill-bg-secondary-inverse)",bgTertiary:"var(--fill-bg-tertiary)",bgOverlayPrimary:"var(--fill-bg-overlay-primary)"},status:{accent:"var(--status-accent)",accentTint:"var(--status-accent-tint)",accentTintLow:"var(--status-accent-tint-low)",negative:"var(--status-negative)",negativeTint:"var(--status-negative-tint)",negativeTintLow:"var(--status-negative-tint-low)",positive:"var(--status-positive)",positiveTint:"var(--status-positive-tint)",positiveTintLow:"var(--status-positive-tint-low)",warning:"var(--status-warning)",warningTint:"var(--status-warning-tint)",warningTintLow:"var(--status-warning-tint-low)",neutral:"var(--status-neutral)",neutralTint:"var(--status-neutral-tint)",neutralTintLow:"var(--status-neutral-tint-low)",transfer:"var(--status-transfer)",transferTint:"var(--status-transfer-tint)",transferTintLow:"var(--status-transfer-tint-low)"},effect:{shadowS:"var(--effect-shadow-s)",shadowM:"var(--effect-shadow-m)",shadowL:"var(--effect-shadow-l)"},scrollbar:{thumbPrimary:"var(--scrollbar-thumb-primary)",trackPrimary:"var(--scrollbar-track-primary)"},gradient:{progressbar:"var(--gradient-progressbar)",progressbarPositive:"var(--gradient-progressbar-positive)",progressbarAccent:"var(--gradient-progressbar-accent)",progressbarNegative:"var(--gradient-progressbar-negative)",progressbarWarning:"var(--gradient-progressbar-warning)",progressbarNeutral:"var(--gradient-progressbar-neutral)",progressbarTransfer:"var(--gradient-progressbar-transfer)",accent1:"var(--gradient-accent-1)",accent1_20:"var(--gradient-accent-1-20)",accent1_10:"var(--gradient-accent-1-10)",negative1:"var(--gradient-negative-1)",negative1_20:"var(--gradient-negative-1-20)",negative1_10:"var(--gradient-negative-1-10)",positive1:"var(--gradient-positive-1)",positive1_20:"var(--gradient-positive-1-20)",positive1_10:"var(--gradient-positive-1-10)",warning1:"var(--gradient-warning-1)",warning1_20:"var(--gradient-warning-1-20)",warning1_10:"var(--gradient-warning-1-10)",neutral1:"var(--gradient-neutral-1)",neutral1_20:"var(--gradient-neutral-1-20)",neutral1_10:"var(--gradient-neutral-1-10)",accentAlternative1:"var(--gradient-accent-alternative-1)",transfer1:"var(--gradient-transfer-1)",transfer1_20:"var(--gradient-transfer-1-20)",transfer1_10:"var(--gradient-transfer-1-10)"}},P_={zero:"var(--corner-zero)",xs:"var(--corner-xs)",sm:"var(--corner-sm)",md:"var(--corner-md)",lg:"var(--corner-lg)",xl:"var(--corner-xl)","2xl":"var(--corner-2xl)","3xl":"var(--corner-3xl)","4xl":"var(--corner-4xl)","5xl":"var(--corner-5xl)","6xl":"var(--corner-6xl)",fullRound:"var(--corner-full-round)"},L_={regular:"var(--fw-regular)",medium:"var(--fw-medium)",semibold:"var(--fw-semibold)",bold:"var(--fw-bold)"},F_={button:{xs:"var(--height-button-xs)",sm:"var(--height-button-sm)",md:"var(--height-button-md)",lg:"var(--height-button-lg)"},avatar:{"2xs":"var(--height-avatar-2xs)",xs:"var(--height-avatar-xs)",sm:"var(--height-avatar-sm)",md:"var(--height-avatar-md)",lg:"var(--height-avatar-lg)",xl:"var(--height-avatar-xl)","2xl":"var(--height-avatar-2xl)"},icon:{"2xs":"var(--height-icon-2xs)",xs:"var(--height-icon-xs)",sm:"var(--height-icon-sm)",md:"var(--height-icon-md)",lg:"var(--height-icon-lg)",xl:"var(--height-icon-xl)"},switch:{sm:"var(--height-switch-sm)",md:"var(--height-switch-md)",lg:"var(--height-switch-lg)"}},$_={primary:"var(--opacity-primary)",secondary:"var(--opacity-secondary)",tertiary:"var(--opacity-tertiary)"},O_={zero:"var(--spacing-zero)",xs:"var(--spacing-xs)",sm:"var(--spacing-sm)",md:"var(--spacing-md)",lg:"var(--spacing-lg)",xl:"var(--spacing-xl)","2xl":"var(--spacing-2xl)","3xl":"var(--spacing-3xl)","4xl":"var(--spacing-4xl)","5xl":"var(--spacing-5xl)","6xl":"var(--spacing-6xl)","7xl":"var(--spacing-7xl)","8xl":"var(--spacing-8xl)","9xl":"var(--spacing-9xl)","10xl":"var(--spacing-10xl)"},I_={general:"var(--transition-general)"},j={spacing:O_,cornerRadius:P_,opacity:$_,transition:I_,fontWeight:L_,height:F_,color:N_},F0=R.keyframes`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const C=require("react/jsx-runtime"),S=require("react"),T=require("@emotion/css"),$s=require("react-dom"),hl=require("@highcharts/react");function D0(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const N=D0(S),k_=D0($s);function A_(e){const{h:t,w:n,m:r,mx:o,my:i,mt:s,mr:a,mb:l,ml:c,p:u,px:f,py:d,pt:h,pr:g,pb:p,pl:m,gap:v,xGap:y,yGap:x,row:b,flex:w,relative:_,absolute:E,display:R,overflow:k,absoluteFill:M,center:F,justifyContent:D,alignItems:j,alignSelf:I,borderWidth:$,borderBottomWidth:H,borderColor:O,borderRadius:P,borderStyle:K,border:G,zIndex:re,minWidth:U,minHeight:Z,maxWidth:Q,maxHeight:ne,flexWrap:oe,flexGrow:me,flexShrink:ee,flexBasis:xe,backgroundColor:Se,position:Ee,top:ze,right:je,bottom:Rt,left:gn,cursor:ot,...Gt}=e;return{spacers:{h:t,w:n,m:r,mx:o,my:i,mt:s,mr:a,mb:l,ml:c,p:u,px:f,py:d,pt:h,pr:g,pb:p,pl:m,gap:v,xGap:y,yGap:x,row:b,flex:w,relative:_,absolute:E,display:R,overflow:k,absoluteFill:M,center:F,justifyContent:D,alignItems:j,alignSelf:I,borderWidth:$,borderBottomWidth:H,borderColor:O,borderRadius:P,borderStyle:K,border:G,zIndex:re,minWidth:U,minHeight:Z,maxWidth:Q,maxHeight:ne,flexWrap:oe,flexGrow:me,flexShrink:ee,flexBasis:xe,backgroundColor:Se,position:Ee,top:ze,right:je,bottom:Rt,left:gn,cursor:ot},rest:Gt}}const N_=e=>T.css({display:e.display??"flex",flexDirection:e.row?"row":"column",height:e.h==="screen"?"100vh":e.h==="full"?"100%":e.h,width:e.w==="screen"?"100vw":e.w==="full"?"100%":e.w,margin:e.m,marginTop:e.mt??e.my,marginBottom:e.mb??e.my,marginLeft:e.ml??e.mx,marginRight:e.mr??e.mx,padding:e.p,paddingTop:e.pt??e.py,paddingBottom:e.pb??e.py,paddingLeft:e.pl??e.px,paddingRight:e.pr??e.px,gap:e.gap,columnGap:e.xGap,rowGap:e.yGap,justifyContent:e.center?"center":e.justifyContent,alignItems:e.center?"center":e.alignItems,alignSelf:e.alignSelf,borderWidth:e.borderWidth,borderBottomWidth:e.borderBottomWidth,borderColor:e.borderColor,borderRadius:e.borderRadius,borderStyle:e.borderStyle,border:e.border,zIndex:e.zIndex,overflow:e.overflow,minWidth:e.minWidth,minHeight:e.minHeight,maxWidth:e.maxWidth,maxHeight:e.maxHeight,flex:e.flex===!0?1:e.flex,flexWrap:e.flexWrap,flexGrow:e.flexGrow,flexShrink:e.flexShrink,flexBasis:e.flexBasis,backgroundColor:e.backgroundColor,position:e?.position?e?.position:e?.absolute?"absolute":e?.relative?"relative":void 0,...e.absoluteFill&&{position:"absolute",top:0,right:0,bottom:0,left:0},top:e?.top,right:e?.right,bottom:e?.bottom,left:e?.left,cursor:e.cursor}),q=S.forwardRef(({className:e,children:t,...n},r)=>{const{spacers:o,rest:i}=A_(n),s=S.useMemo(()=>N_(o),[o]);return C.jsx("div",{ref:r,className:T.cx(s,e),...i,children:t})});q.displayName="Box";var po=(e=>(e[e._1920=1920]="_1920",e[e._1440=1440]="_1440",e[e._1280=1280]="_1280",e[e._1200=1200]="_1200",e[e._1024=1024]="_1024",e[e._992=992]="_992",e[e._768=768]="_768",e[e._576=576]="_576",e[e._480=480]="_480",e[e._375=375]="_375",e))(po||{});const Ar={xs:480,sm:576,md:768,lg:992,xl:1200},M_=e=>{const{direction:t="max"}=e||{},[n,r]=S.useState(typeof window<"u"?window.innerWidth:Ar.xl);S.useEffect(()=>{if(typeof window>"u")return;const i=()=>r(window.innerWidth);return window.addEventListener("resize",i),()=>window.removeEventListener("resize",i)},[]);const o=S.useCallback(i=>{const s=Ar[i];return t==="min"?n>=s:n<s},[n,t]);return{windowWidth:n,match:o,isXs:o("xs"),isSm:o("sm"),isMd:o("md"),isLg:o("lg"),isXl:o("xl")}};function Bo(e,t){const{current:n}=S.useRef(e!==void 0),[r,o]=S.useState(t),i=n?e:r,s=S.useCallback(a=>{n||o(a)},[]);return[i,s]}function Pf(e,t,n,r=""){if(n)return e[`${t}_${n}${r}`]}function P_(e,t,n){return Pf(e,t,n,"Weight")}function L_(e,t,n){return Pf(e,t,n,"Size")}const F_={border:{accentPrimary:"var(--border-accent-primary)",accentPrimaryHover:"var(--border-accent-primary-hover)",accentSecondary:"var(--border-accent-secondary)",accentSecondaryHover:"var(--border-accent-secondary-hover)",negativePrimary:"var(--border-negative-primary)",negativePrimaryHover:"var(--border-negative-primary-hover)",negativeSecondary:"var(--border-negative-secondary)",negativeSecondaryHover:"var(--border-negative-secondary-hover)",positivePrimary:"var(--border-positive-primary)",positivePrimaryHover:"var(--border-positive-primary-hover)",positiveSecondary:"var(--border-positive-secondary)",positiveSecondaryHover:"var(--border-positive-secondary-hover)",warningPrimary:"var(--border-warning-primary)",warningPrimaryHover:"var(--border-warning-primary-hover)",warningSecondary:"var(--border-warning-secondary)",warningSecondaryHover:"var(--border-warning-secondary-hover)",neutralPrimary:"var(--border-neutral-primary)",neutralPrimaryHover:"var(--border-neutral-primary-hover)",neutralAlphaBasic:"var(--border-neutral-alpha-basic)",neutralAlphaLow:"var(--border-neutral-alpha-low)",neutralAlphaHigh:"var(--border-neutral-alpha-high)",transferPrimary:"var(--border-transfer-primary)",transferPrimaryHover:"var(--border-transfer-primary-hover)",transferSecondary:"var(--border-transfer-secondary)",transferSecondaryHover:"var(--border-transfer-secondary-hover)"},text:{primary:"var(--text-primary)",primaryInverse:"var(--text-primary-inverse)",primaryHover:"var(--text-primary-hover)",secondary:"var(--text-secondary)",secondaryInverse:"var(--text-secondary-inverse)",secondaryHover:"var(--text-secondary-hover)",tertiary:"var(--text-tertiary)",tertiaryInverse:"var(--text-tertiary-inverse)",tertiaryHover:"var(--text-tertiary-hover)",positive:"var(--text-positive)",positiveHover:"var(--text-positive-hover)",negative:"var(--text-negative)",negativeHover:"var(--text-negative-hover)",warning:"var(--text-warning)",warningHover:"var(--text-warning-hover)",accent:"var(--text-accent)",accentHover:"var(--text-accent-hover)",inverse:"var(--text-inverse)",transfer:"var(--text-transfer)",transferHover:"var(--text-transfer-hover)"},icon:{primary:"var(--icon-primary)",primaryHover:"var(--icon-primary-hover)",primaryInverse:"var(--icon-primary-inverse)",secondary:"var(--icon-secondary)",secondaryHover:"var(--icon-secondary-hover)",tertiary:"var(--icon-tertiary)",tertiaryInverse:"var(--icon-tertiary-inverse)",tertiaryHover:"var(--icon-tertiary-hover)",positive:"var(--icon-positive)",positiveHover:"var(--icon-positive-hover)",negative:"var(--icon-negative)",negativeHover:"var(--icon-negative-hover)",warning:"var(--icon-warning)",warningHover:"var(--icon-warning-hover)",accent:"var(--icon-accent)",accentHover:"var(--icon-accent-hover)",inverse:"var(--icon-inverse)",transfer:"var(--icon-transfer)",transferHover:"var(--icon-transfer-hover)"},fill:{accentPrimary:"var(--fill-accent-primary)",accentPrimaryHover:"var(--fill-accent-primary-hover)",accentSecondary:"var(--fill-accent-secondary)",accentSecondaryHover:"var(--fill-accent-secondary-hover)",accentTintHigh:"var(--fill-accent-tint-high)",accentTint:"var(--fill-accent-tint)",accentTintLow:"var(--fill-accent-tint-low)",accentTransparent:"var(--fill-accent-transparent)",positivePrimary:"var(--fill-positive-primary)",positivePrimaryHover:"var(--fill-positive-primary-hover)",positiveSecondary:"var(--fill-positive-secondary)",positiveSecondaryHover:"var(--fill-positive-secondary-hover)",positiveTintHigh:"var(--fill-positive-tint-high)",positiveTint:"var(--fill-positive-tint)",positiveTintLow:"var(--fill-positive-tint-low)",positiveTransparent:"var(--fill-positive-transparent)",negativePrimary:"var(--fill-negative-primary)",negativePrimaryHover:"var(--fill-negative-primary-hover)",negativeSecondary:"var(--fill-negative-secondary)",negativeSecondaryHover:"var(--fill-negative-secondary-hover)",negativeTintHigh:"var(--fill-negative-tint-high)",negativeTint:"var(--fill-negative-tint)",negativeTintLow:"var(--fill-negative-tint-low)",negativeTransparent:"var(--fill-negative-transparent)",warningPrimary:"var(--fill-warning-primary)",warningPrimaryHover:"var(--fill-warning-primary-hover)",warningSecondary:"var(--fill-warning-secondary)",warningSecondaryHover:"var(--fill-warning-secondary-hover)",warningTintHigh:"var(--fill-warning-tint-high)",warningTint:"var(--fill-warning-tint)",warningTintLow:"var(--fill-warning-tint-low)",warningTransparent:"var(--fill-warning-transparent)",neutralPrimary:"var(--fill-neutral-primary)",neutralPrimaryHover:"var(--fill-neutral-primary-hover)",neutralSecondary:"var(--fill-neutral-secondary)",neutralSecondaryInverse:"var(--fill-neutral-secondary-inverse)",neutralSecondaryHover:"var(--fill-neutral-secondary-hover)",neutralTint:"var(--fill-neutral-tint)",neutralTintLow:"var(--fill-neutral-tint-low)",transferPrimary:"var(--fill-transfer-primary)",transferPrimaryHover:"var(--fill-transfer-primary-hover)",transferSecondary:"var(--fill-transfer-secondary)",transferSecondaryHover:"var(--fill-transfer-secondary-hover)",transferTintHigh:"var(--fill-transfer-tint-high)",transferTint:"var(--fill-transfer-tint)",transferTintLow:"var(--fill-transfer-tint-low)",transferTransparent:"var(--fill-transfer-transparent)",bgPrimary:"var(--fill-bg-primary)",bgPrimaryInverse:"var(--fill-bg-primary-inverse)",bgSecondary:"var(--fill-bg-secondary)",bgSecondaryInverse:"var(--fill-bg-secondary-inverse)",bgTertiary:"var(--fill-bg-tertiary)",bgOverlayPrimary:"var(--fill-bg-overlay-primary)"},status:{accent:"var(--status-accent)",accentTint:"var(--status-accent-tint)",accentTintLow:"var(--status-accent-tint-low)",negative:"var(--status-negative)",negativeTint:"var(--status-negative-tint)",negativeTintLow:"var(--status-negative-tint-low)",positive:"var(--status-positive)",positiveTint:"var(--status-positive-tint)",positiveTintLow:"var(--status-positive-tint-low)",warning:"var(--status-warning)",warningTint:"var(--status-warning-tint)",warningTintLow:"var(--status-warning-tint-low)",neutral:"var(--status-neutral)",neutralTint:"var(--status-neutral-tint)",neutralTintLow:"var(--status-neutral-tint-low)",transfer:"var(--status-transfer)",transferTint:"var(--status-transfer-tint)",transferTintLow:"var(--status-transfer-tint-low)"},effect:{shadowS:"var(--effect-shadow-s)",shadowM:"var(--effect-shadow-m)",shadowL:"var(--effect-shadow-l)"},scrollbar:{thumbPrimary:"var(--scrollbar-thumb-primary)",trackPrimary:"var(--scrollbar-track-primary)"},gradient:{progressbar:"var(--gradient-progressbar)",progressbarPositive:"var(--gradient-progressbar-positive)",progressbarAccent:"var(--gradient-progressbar-accent)",progressbarNegative:"var(--gradient-progressbar-negative)",progressbarWarning:"var(--gradient-progressbar-warning)",progressbarNeutral:"var(--gradient-progressbar-neutral)",progressbarTransfer:"var(--gradient-progressbar-transfer)",accent1:"var(--gradient-accent-1)",accent1_20:"var(--gradient-accent-1-20)",accent1_10:"var(--gradient-accent-1-10)",negative1:"var(--gradient-negative-1)",negative1_20:"var(--gradient-negative-1-20)",negative1_10:"var(--gradient-negative-1-10)",positive1:"var(--gradient-positive-1)",positive1_20:"var(--gradient-positive-1-20)",positive1_10:"var(--gradient-positive-1-10)",warning1:"var(--gradient-warning-1)",warning1_20:"var(--gradient-warning-1-20)",warning1_10:"var(--gradient-warning-1-10)",neutral1:"var(--gradient-neutral-1)",neutral1_20:"var(--gradient-neutral-1-20)",neutral1_10:"var(--gradient-neutral-1-10)",accentAlternative1:"var(--gradient-accent-alternative-1)",transfer1:"var(--gradient-transfer-1)",transfer1_20:"var(--gradient-transfer-1-20)",transfer1_10:"var(--gradient-transfer-1-10)"}},$_={zero:"var(--corner-zero)",xs:"var(--corner-xs)",sm:"var(--corner-sm)",md:"var(--corner-md)",lg:"var(--corner-lg)",xl:"var(--corner-xl)","2xl":"var(--corner-2xl)","3xl":"var(--corner-3xl)","4xl":"var(--corner-4xl)","5xl":"var(--corner-5xl)","6xl":"var(--corner-6xl)",fullRound:"var(--corner-full-round)"},O_={regular:"var(--fw-regular)",medium:"var(--fw-medium)",semibold:"var(--fw-semibold)",bold:"var(--fw-bold)"},I_={button:{xs:"var(--height-button-xs)",sm:"var(--height-button-sm)",md:"var(--height-button-md)",lg:"var(--height-button-lg)"},avatar:{"2xs":"var(--height-avatar-2xs)",xs:"var(--height-avatar-xs)",sm:"var(--height-avatar-sm)",md:"var(--height-avatar-md)",lg:"var(--height-avatar-lg)",xl:"var(--height-avatar-xl)","2xl":"var(--height-avatar-2xl)"},icon:{"2xs":"var(--height-icon-2xs)",xs:"var(--height-icon-xs)",sm:"var(--height-icon-sm)",md:"var(--height-icon-md)",lg:"var(--height-icon-lg)",xl:"var(--height-icon-xl)"},switch:{sm:"var(--height-switch-sm)",md:"var(--height-switch-md)",lg:"var(--height-switch-lg)"}},D_={primary:"var(--opacity-primary)",secondary:"var(--opacity-secondary)",tertiary:"var(--opacity-tertiary)"},j_={zero:"var(--spacing-zero)",xs:"var(--spacing-xs)",sm:"var(--spacing-sm)",md:"var(--spacing-md)",lg:"var(--spacing-lg)",xl:"var(--spacing-xl)","2xl":"var(--spacing-2xl)","3xl":"var(--spacing-3xl)","4xl":"var(--spacing-4xl)","5xl":"var(--spacing-5xl)","6xl":"var(--spacing-6xl)","7xl":"var(--spacing-7xl)","8xl":"var(--spacing-8xl)","9xl":"var(--spacing-9xl)","10xl":"var(--spacing-10xl)"},V_={general:"var(--transition-general)"},V={spacing:j_,cornerRadius:$_,opacity:D_,transition:V_,fontWeight:O_,height:I_,color:F_},j0=T.keyframes`
2
2
  0% {
3
3
  box-shadow: 0 16px 0 var(--loader-color);
4
4
  }
5
5
  100% {
6
6
  box-shadow: 0 20px 0 var(--loader-color);
7
7
  }
8
- `,Dg={content:'""',position:"absolute",width:8,height:8,borderRadius:"50%",boxShadow:"0 16px 0 var(--loader-color)",animationName:F0,animationDuration:"0.4s",animationTimingFunction:"ease-in-out",animationIterationCount:"infinite",animationDirection:"alternate"},D_={loader:R.css({width:8,height:8,borderRadius:"50%",boxShadow:"0 16px 0 var(--loader-color)",position:"relative",animationName:F0,animationDuration:"0.4s",animationTimingFunction:"ease-in-out",animationIterationCount:"infinite",animationDirection:"alternate",animationDelay:"0.32s",display:"block",top:-19,opacity:.9,"&::before":{...Dg,left:-12,animationDelay:"0.48s"},"&::after":{...Dg,right:-12,animationDelay:"0.16s"}})},$0=({color:e=j.color.text.accent})=>C.jsx("span",{className:R.cx(D_.loader,R.css({"--loader-color":e}))}),O0=e=>M.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("path",{d:"M18 6L6 18M6 6L18 18",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}));var Dn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function _f(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Rc={exports:{}};var jg;function j_(){return jg||(jg=1,(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var i="",s=0;s<arguments.length;s++){var a=arguments[s];a&&(i=o(i,r(a)))}return i}function r(i){if(typeof i=="string"||typeof i=="number")return i;if(typeof i!="object")return"";if(Array.isArray(i))return n.apply(null,i);if(i.toString!==Object.prototype.toString&&!i.toString.toString().includes("[native code]"))return i.toString();var s="";for(var a in i)t.call(i,a)&&i[a]&&(s=o(s,a));return s}function o(i,s){return s?i?i+" "+s:i+s:i}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(Rc)),Rc.exports}var V_=j_();const Tf=_f(V_),B_=R.keyframes`
8
+ `,Bg={content:'""',position:"absolute",width:8,height:8,borderRadius:"50%",boxShadow:"0 16px 0 var(--loader-color)",animationName:j0,animationDuration:"0.4s",animationTimingFunction:"ease-in-out",animationIterationCount:"infinite",animationDirection:"alternate"},B_={loader:T.css({width:8,height:8,borderRadius:"50%",boxShadow:"0 16px 0 var(--loader-color)",position:"relative",animationName:j0,animationDuration:"0.4s",animationTimingFunction:"ease-in-out",animationIterationCount:"infinite",animationDirection:"alternate",animationDelay:"0.32s",display:"block",top:-19,opacity:.9,"&::before":{...Bg,left:-12,animationDelay:"0.48s"},"&::after":{...Bg,right:-12,animationDelay:"0.16s"}})},V0=({color:e=V.color.text.accent,className:t})=>C.jsx("span",{className:T.cx(B_.loader,T.css({"--loader-color":e}),t)}),B0=e=>N.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M18 6L6 18M6 6L18 18",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}));var Bn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Lf(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var $c={exports:{}};var zg;function z_(){return zg||(zg=1,(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var i="",s=0;s<arguments.length;s++){var a=arguments[s];a&&(i=o(i,r(a)))}return i}function r(i){if(typeof i=="string"||typeof i=="number")return i;if(typeof i!="object")return"";if(Array.isArray(i))return n.apply(null,i);if(i.toString!==Object.prototype.toString&&!i.toString.toString().includes("[native code]"))return i.toString();var s="";for(var a in i)t.call(i,a)&&i[a]&&(s=o(s,a));return s}function o(i,s){return s?i?i+" "+s:i+s:i}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})($c)),$c.exports}var H_=z_();const mo=Lf(H_),W_=T.keyframes`
9
9
  0% {
10
10
  transform: scale(0);
11
11
  opacity: 0.36;
@@ -14,7 +14,7 @@
14
14
  transform: scale(1);
15
15
  opacity: 0;
16
16
  }
17
- `,Vg={rippleOverlay:R.css({position:"absolute",inset:0,pointerEvents:"none",overflow:"visible",borderRadius:"inherit",zIndex:0}),ripple:R.css({position:"absolute",borderRadius:"50%",transform:"scale(0)",transformOrigin:"center center",opacity:.36,willChange:"transform, opacity",animationName:B_,animationTimingFunction:"cubic-bezier(0.4, 0, 0.2, 1)",animationFillMode:"forwards"})},kc="button, a, input, label, [role='button'], [data-ripple]";function z_(e){if(typeof e.composedPath=="function")return e.composedPath();const t=[];let n=e.target;for(;n;)t.push(n),n=n.parentNode||n.host;return t.push(window),t}const $o=S.forwardRef(({color:e="rgba(0,0,0,0.18)",duration:t=1e3,radius:n="auto",className:r},o)=>{const i=S.useRef(null),[s,a]=S.useState([]),l=S.useRef([]),c=S.useRef(1),u=S.useRef(null),f=()=>{l.current.map(p=>clearTimeout(p)),l.current=[]},d=S.useCallback((p,m,x,y)=>{if(typeof window>"u")return;const v=x.getBoundingClientRect(),b=n==="auto"?Math.max(v.width,v.height)*2:n,w=p-y.left,_=m-y.top,E=Math.max(0,v.top-y.top),T=Math.max(0,v.left-y.left),k=Math.max(0,y.right-v.right),P=Math.max(0,y.bottom-v.bottom),D=window.getComputedStyle(x).borderRadius||"0px",I=c.current++,$={id:I,left:w-b/2,top:_-b/2,size:Math.ceil(b),clip:{top:Math.round(E),right:Math.round(k),bottom:Math.round(P),left:Math.round(T)},borderRadius:D};a(U=>[...U,$]);const H=window.setTimeout(()=>{a(U=>U.filter(L=>L.id!==I))},t+80);l.current.push(H)},[t,n]),h=S.useCallback(p=>{try{if(!i.current)return;const m=i.current,x=m.parentElement;if(!x)return;const y=z_(p);let v=null;for(const T of y)if(T instanceof Element){if(T===x)break;if(T.matches&&T.matches(kc)){v=T;break}}if(v||(v=x),v.closest&&(v.closest("[disabled]")||v.getAttribute("aria-disabled")==="true"||v.classList.contains("ripple-disabled")))return;const b=p.target;if(b?.closest&&(b.closest("[disabled]")||b.getAttribute?.("aria-disabled")==="true"))return;const w=m.getBoundingClientRect(),{clientX:_}=p,{clientY:E}=p;d(_,E,v,w)}catch{}},[d]),g=S.useCallback(p=>{if(!i.current||!(p.key==="Enter"||p.key===" "))return;const m=i.current,x=m.parentElement;if(!x)return;const y=document.activeElement;let v=null;if(y instanceof Element&&y.matches(kc)&&(v=y),v||(v=x),v.closest&&(v.closest("[disabled]")||v.getAttribute("aria-disabled")==="true"))return;const b=m.getBoundingClientRect(),w=v.getBoundingClientRect().left+v.getBoundingClientRect().width/2,_=v.getBoundingClientRect().top+v.getBoundingClientRect().height/2;d(w,_,v,b)},[d]);return S.useImperativeHandle(o,()=>({trigger:({center:p=!0,x:m,y:x}={})=>{const y=i.current;if(!y)return;const v=y.parentElement;if(!v)return;const b=y.getBoundingClientRect(),w=document.activeElement instanceof Element&&document.activeElement.matches(kc)?document.activeElement:v,_=p?w.getBoundingClientRect().left+w.getBoundingClientRect().width/2:m??b.left+b.width/2,E=p?w.getBoundingClientRect().top+w.getBoundingClientRect().height/2:x??b.top+b.height/2;d(_,E,w,b)}}),[d]),S.useEffect(()=>{const p=i.current;if(!p)return;const m=p.parentElement;if(!m||typeof window>"u")return;const x=window.getComputedStyle(m);let y=!1;return x.position==="static"&&(m.style.position="relative",y=!0,u.current=m),m.addEventListener("pointerdown",h,!0),m.addEventListener("keydown",g),()=>{m.removeEventListener("pointerdown",h,!0),m.removeEventListener("keydown",g),y&&u.current&&(u.current.style.position="",u.current=null),f()}},[h,g]),S.useEffect(()=>()=>f(),[]),C.jsx("div",{ref:i,className:`${Vg.rippleOverlay} ${r??""}`,"aria-hidden":!0,children:s.map(p=>C.jsx("span",{className:Vg.ripple,style:{left:`${p.left}px`,top:`${p.top}px`,width:`${p.size}px`,height:`${p.size}px`,backgroundColor:e,animationDuration:`${t}ms`,clipPath:`inset(${p.clip.top}px ${p.clip.right}px ${p.clip.bottom}px ${p.clip.left}px round ${p.borderRadius})`}},p.id))})}),H_=R.css({display:"flex",alignItems:"center",justifyContent:"center",transition:j.transition.general,position:"relative",overflow:"hidden","& svg":{transition:j.transition.general},"&:disabled":{opacity:.5}}),W_={md:R.css({minHeight:j.height.button.md,minWidth:j.height.button.md,borderRadius:j.cornerRadius.md,"& svg, & img":{width:j.height.icon.md,height:j.height.icon.md}}),sm:R.css({minHeight:j.height.button.sm,minWidth:j.height.button.sm,borderRadius:j.cornerRadius.md,"& svg, & img":{width:j.height.icon.sm,height:j.height.icon.sm}}),xs:R.css({minHeight:j.height.button.xs,minWidth:j.height.button.xs,borderRadius:j.cornerRadius.sm,"& svg, & img":{width:j.height.icon.sm,height:j.height.icon.sm}}),custom:R.css({})},K_={primary:R.css({backgroundColor:j.color.fill.accentPrimary,"& svg":{color:j.color.icon.primaryInverse},"&:hover:not(:disabled), &:active:not(:disabled)":{backgroundColor:j.color.fill.accentPrimaryHover,"& svg":{color:j.color.icon.primaryInverse}}}),secondary:R.css({backgroundColor:j.color.fill.accentSecondary,"& svg":{color:j.color.icon.primary},"&:hover:not(:disabled), &:active:not(:disabled)":{backgroundColor:j.color.fill.accentSecondaryHover,"& svg":{color:j.color.icon.primaryHover}}}),negative:R.css({backgroundColor:j.color.fill.negativeSecondary,"& svg":{color:j.color.icon.primary},"&:hover:not(:disabled), &:active:not(:disabled)":{backgroundColor:j.color.fill.negativeSecondaryHover,"& svg":{color:j.color.icon.primaryHover}}}),positive:R.css({backgroundColor:j.color.fill.positiveSecondary,"& svg":{color:j.color.icon.primary},"&:hover:not(:disabled), &:active:not(:disabled)":{backgroundColor:j.color.fill.positiveSecondaryHover,"& svg":{color:j.color.icon.primaryHover}}}),warning:R.css({backgroundColor:j.color.fill.warningSecondary,"& svg":{color:j.color.icon.primary},"&:hover:not(:disabled), &:active:not(:disabled)":{backgroundColor:j.color.fill.warningSecondaryHover,"& svg":{color:j.color.icon.primaryHover}}}),neutral:R.css({backgroundColor:j.color.fill.neutralSecondary,"& svg":{color:j.color.icon.primary},"&:hover:not(:disabled), &:active:not(:disabled)":{backgroundColor:j.color.fill.neutralSecondaryHover,"& svg":{color:j.color.icon.primaryHover}}}),transfer:R.css({backgroundColor:j.color.fill.transferSecondary,"& svg":{color:j.color.icon.primary},"&:hover:not(:disabled), &:active:not(:disabled)":{backgroundColor:j.color.fill.transferSecondaryHover,"& svg":{color:j.color.icon.primaryHover}}}),"neutral-white":R.css({backgroundColor:j.color.fill.bgPrimary,"& svg":{color:j.color.icon.primary},"&:hover:not(:disabled), &:active:not(:disabled)":{backgroundColor:j.color.fill.bgSecondary,"& svg":{color:j.color.icon.primaryHover}}}),"no-bg":R.css({backgroundColor:"transparent","& svg":{color:j.color.icon.primary},"&:hover:not(:disabled), &:active:not(:disabled)":{backgroundColor:j.color.fill.bgSecondary,"& svg":{color:j.color.icon.primaryHover}}}),custom:R.css({})};function fr({attr:e,children:t,className:n,type:r="button",color:o="primary",size:i="md",...s}){return C.jsxs("button",{...e,...s,type:r,className:Tf(H_,W_[i],K_[o],n),children:[C.jsx($o,{}),t]})}const I0=S.createContext({isOpen:!1,onClose:()=>{}}),U_=()=>S.useContext(I0),Nn=(e,t="max")=>t==="min"?`@media (min-width: ${e}px)`:`@media (max-width: ${e-1}px)`,us={xs:(e="max")=>Nn(Er.xs,e),sm:(e="max")=>Nn(Er.sm,e),md:(e="max")=>Nn(Er.md,e),lg:(e="max")=>Nn(Er.lg,e),xl:(e="max")=>Nn(Er.xl,e),bp375:(e="max")=>Nn(lo._375,e),bp1024:(e="max")=>Nn(lo._1024,e),bp1280:(e="max")=>Nn(lo._1280,e),bp1440:(e="max")=>Nn(lo._1440,e),bp1920:(e="max")=>Nn(lo._1920,e)},G_=R.keyframes`
17
+ `,Hg={rippleOverlay:T.css({position:"absolute",inset:0,pointerEvents:"none",overflow:"visible",borderRadius:"inherit",zIndex:0}),ripple:T.css({position:"absolute",borderRadius:"50%",transform:"scale(0)",transformOrigin:"center center",opacity:.36,willChange:"transform, opacity",animationName:W_,animationTimingFunction:"cubic-bezier(0.4, 0, 0.2, 1)",animationFillMode:"forwards"})},Oc="button, a, input, label, [role='button'], [data-ripple]";function K_(e){if(typeof e.composedPath=="function")return e.composedPath();const t=[];let n=e.target;for(;n;)t.push(n),n=n.parentNode||n.host;return t.push(window),t}const zo=S.forwardRef(({color:e="rgba(0,0,0,0.18)",duration:t=1e3,radius:n="auto",className:r},o)=>{const i=S.useRef(null),[s,a]=S.useState([]),l=S.useRef([]),c=S.useRef(1),u=S.useRef(null),f=()=>{l.current.map(p=>clearTimeout(p)),l.current=[]},d=S.useCallback((p,m,v,y)=>{if(typeof window>"u")return;const x=v.getBoundingClientRect(),b=n==="auto"?Math.max(x.width,x.height)*2:n,w=p-y.left,_=m-y.top,E=Math.max(0,x.top-y.top),R=Math.max(0,x.left-y.left),k=Math.max(0,y.right-x.right),M=Math.max(0,y.bottom-x.bottom),D=window.getComputedStyle(v).borderRadius||"0px",j=c.current++,I={id:j,left:w-b/2,top:_-b/2,size:Math.ceil(b),clip:{top:Math.round(E),right:Math.round(k),bottom:Math.round(M),left:Math.round(R)},borderRadius:D};a(H=>[...H,I]);const $=window.setTimeout(()=>{a(H=>H.filter(O=>O.id!==j))},t+80);l.current.push($)},[t,n]),h=S.useCallback(p=>{try{if(!i.current)return;const m=i.current,v=m.parentElement;if(!v)return;const y=K_(p);let x=null;for(const R of y)if(R instanceof Element){if(R===v)break;if(R.matches&&R.matches(Oc)){x=R;break}}if(x||(x=v),x.closest&&(x.closest("[disabled]")||x.getAttribute("aria-disabled")==="true"||x.classList.contains("ripple-disabled")))return;const b=p.target;if(b?.closest&&(b.closest("[disabled]")||b.getAttribute?.("aria-disabled")==="true"))return;const w=m.getBoundingClientRect(),{clientX:_}=p,{clientY:E}=p;d(_,E,x,w)}catch{}},[d]),g=S.useCallback(p=>{if(!i.current||!(p.key==="Enter"||p.key===" "))return;const m=i.current,v=m.parentElement;if(!v)return;const y=document.activeElement;let x=null;if(y instanceof Element&&y.matches(Oc)&&(x=y),x||(x=v),x.closest&&(x.closest("[disabled]")||x.getAttribute("aria-disabled")==="true"))return;const b=m.getBoundingClientRect(),w=x.getBoundingClientRect().left+x.getBoundingClientRect().width/2,_=x.getBoundingClientRect().top+x.getBoundingClientRect().height/2;d(w,_,x,b)},[d]);return S.useImperativeHandle(o,()=>({trigger:({center:p=!0,x:m,y:v}={})=>{const y=i.current;if(!y)return;const x=y.parentElement;if(!x)return;const b=y.getBoundingClientRect(),w=document.activeElement instanceof Element&&document.activeElement.matches(Oc)?document.activeElement:x,_=p?w.getBoundingClientRect().left+w.getBoundingClientRect().width/2:m??b.left+b.width/2,E=p?w.getBoundingClientRect().top+w.getBoundingClientRect().height/2:v??b.top+b.height/2;d(_,E,w,b)}}),[d]),S.useEffect(()=>{const p=i.current;if(!p)return;const m=p.parentElement;if(!m||typeof window>"u")return;const v=window.getComputedStyle(m);let y=!1;return v.position==="static"&&(m.style.position="relative",y=!0,u.current=m),m.addEventListener("pointerdown",h,!0),m.addEventListener("keydown",g),()=>{m.removeEventListener("pointerdown",h,!0),m.removeEventListener("keydown",g),y&&u.current&&(u.current.style.position="",u.current=null),f()}},[h,g]),S.useEffect(()=>()=>f(),[]),C.jsx("div",{ref:i,className:`${Hg.rippleOverlay} ${r??""}`,"aria-hidden":!0,children:s.map(p=>C.jsx("span",{className:Hg.ripple,style:{left:`${p.left}px`,top:`${p.top}px`,width:`${p.size}px`,height:`${p.size}px`,backgroundColor:e,animationDuration:`${t}ms`,clipPath:`inset(${p.clip.top}px ${p.clip.right}px ${p.clip.bottom}px ${p.clip.left}px round ${p.borderRadius})`}},p.id))})}),U_=T.css({display:"flex",alignItems:"center",justifyContent:"center",transition:V.transition.general,position:"relative",overflow:"hidden","& svg":{transition:V.transition.general},"&:disabled":{opacity:.5}}),G_={md:T.css({minHeight:V.height.button.md,minWidth:V.height.button.md,borderRadius:V.cornerRadius.md,"& svg, & img":{width:V.height.icon.md,height:V.height.icon.md}}),sm:T.css({minHeight:V.height.button.sm,minWidth:V.height.button.sm,borderRadius:V.cornerRadius.md,"& svg, & img":{width:V.height.icon.sm,height:V.height.icon.sm}}),xs:T.css({minHeight:V.height.button.xs,minWidth:V.height.button.xs,borderRadius:V.cornerRadius.sm,"& svg, & img":{width:V.height.icon.sm,height:V.height.icon.sm}}),custom:T.css({})},q_={primary:T.css({backgroundColor:V.color.fill.accentPrimary,":where(&) svg":{color:V.color.icon.primaryInverse},"&:hover:not(:disabled), &:active:not(:disabled)":{backgroundColor:V.color.fill.accentPrimaryHover,":where(&) svg":{color:V.color.icon.primaryInverse}}}),secondary:T.css({backgroundColor:V.color.fill.accentSecondary,":where(&) svg":{color:V.color.icon.primary},"&:hover:not(:disabled), &:active:not(:disabled)":{backgroundColor:V.color.fill.accentSecondaryHover,":where(&) svg":{color:V.color.icon.primaryHover}}}),negative:T.css({backgroundColor:V.color.fill.negativeSecondary,":where(&) svg":{color:V.color.icon.primary},"&:hover:not(:disabled), &:active:not(:disabled)":{backgroundColor:V.color.fill.negativeSecondaryHover,":where(&) svg":{color:V.color.icon.primaryHover}}}),positive:T.css({backgroundColor:V.color.fill.positiveSecondary,":where(&) svg":{color:V.color.icon.primary},"&:hover:not(:disabled), &:active:not(:disabled)":{backgroundColor:V.color.fill.positiveSecondaryHover,":where(&) svg":{color:V.color.icon.primaryHover}}}),warning:T.css({backgroundColor:V.color.fill.warningSecondary,":where(&) svg":{color:V.color.icon.primary},"&:hover:not(:disabled), &:active:not(:disabled)":{backgroundColor:V.color.fill.warningSecondaryHover,":where(&) svg":{color:V.color.icon.primaryHover}}}),neutral:T.css({backgroundColor:V.color.fill.neutralSecondary,":where(&) svg":{color:V.color.icon.primary},"&:hover:not(:disabled), &:active:not(:disabled)":{backgroundColor:V.color.fill.neutralSecondaryHover,":where(&) svg":{color:V.color.icon.primaryHover}}}),transfer:T.css({backgroundColor:V.color.fill.transferSecondary,":where(&) svg":{color:V.color.icon.primary},"&:hover:not(:disabled), &:active:not(:disabled)":{backgroundColor:V.color.fill.transferSecondaryHover,":where(&) svg":{color:V.color.icon.primaryHover}}}),"neutral-white":T.css({backgroundColor:V.color.fill.bgPrimary,":where(&) svg":{color:V.color.icon.primary},"&:hover:not(:disabled), &:active:not(:disabled)":{backgroundColor:V.color.fill.bgSecondary,":where(&) svg":{color:V.color.icon.primaryHover}}}),"no-bg":T.css({backgroundColor:"transparent",":where(&) svg":{color:V.color.icon.primary},"&:hover:not(:disabled), &:active:not(:disabled)":{backgroundColor:V.color.fill.bgSecondary,":where(&) svg":{color:V.color.icon.primaryHover}}}),custom:T.css({})};function pr({attr:e,children:t,className:n,type:r="button",color:o="primary",size:i="md",...s}){return C.jsxs("button",{...e,...s,type:r,className:mo(U_,G_[i],q_[o],n),children:[C.jsx(zo,{}),t]})}const z0=S.createContext({isOpen:!1,onClose:()=>{}}),Y_=()=>S.useContext(z0),Fn=(e,t="max")=>t==="min"?`@media (min-width: ${e}px)`:`@media (max-width: ${e-1}px)`,vs={xs:(e="max")=>Fn(Ar.xs,e),sm:(e="max")=>Fn(Ar.sm,e),md:(e="max")=>Fn(Ar.md,e),lg:(e="max")=>Fn(Ar.lg,e),xl:(e="max")=>Fn(Ar.xl,e),bp375:(e="max")=>Fn(po._375,e),bp1024:(e="max")=>Fn(po._1024,e),bp1280:(e="max")=>Fn(po._1280,e),bp1440:(e="max")=>Fn(po._1440,e),bp1920:(e="max")=>Fn(po._1920,e)},X_=T.keyframes`
18
18
  0% {
19
19
  opacity: 0;
20
20
  transform: scale(0.95);
@@ -23,7 +23,7 @@
23
23
  opacity: 1;
24
24
  transform: none;
25
25
  }
26
- `,ha={overlay:R.css({backdropFilter:"blur(5px)"}),modal:R.css({animationDuration:"0.2s",animationTimingFunction:"ease-in-out",animationName:G_,maxWidth:`calc(100vw - ${j.spacing["3xl"]})`,maxHeight:`calc(100vh - ${j.spacing["7xl"]} - ${j.spacing["7xl"]})`,borderRadius:j.cornerRadius["2xl"],backgroundColor:j.color.fill.bgPrimary,boxShadow:`0 4px 20px 0 ${j.color.effect.shadowS}`,[us.sm()]:{flex:1}}),closeButton:R.css({position:"absolute",zIndex:1,top:j.spacing.lg,right:j.spacing.lg}),size_lg:R.css({width:874}),size_md:R.css({width:650}),size_sm:R.css({width:426})},D0=S.forwardRef(({isOpen:e,onClose:t,overlayClassName:n,modalClassName:r,size:o="md",closeOnBackdropClick:i=!0,closeOnEsc:s=!0,disableBodyScroll:a=!0,showAbsoluteCloseButton:l,children:c},u)=>{S.useEffect(()=>{if(a&&e&&typeof window<"u"&&typeof document<"u"){const h=window.getComputedStyle(document.body).overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=h}}},[e,a]);const f=S.useCallback(h=>{h.key==="Escape"&&t()},[t]);S.useEffect(()=>{if(typeof window<"u"&&typeof document<"u"&&s&&e)return document.addEventListener("keydown",f),()=>document.removeEventListener("keydown",f)},[e,s,f]);const d=S.useCallback(h=>{i&&h.target===h.currentTarget&&t()},[i,t]);return e?C.jsx(Gi,{children:C.jsx(I0.Provider,{value:{isOpen:e,onClose:t},children:C.jsx(G,{position:"fixed",top:0,right:0,bottom:0,left:0,row:!0,center:!0,flex:1,onClick:d,backgroundColor:j.color.fill.bgOverlayPrimary,className:R.cx(ha.overlay,n),zIndex:1,children:C.jsxs(G,{ref:u,className:R.cx(ha.modal,ha[`size_${o}`],r),relative:!0,children:[l&&C.jsx(fr,{className:ha.closeButton,onClick:t,color:"neutral",children:C.jsx(O0,{})}),c]})})})}):null});D0.displayName="Modal";const q_=R.css({borderTop:`1px solid ${j.color.border.neutralAlphaBasic}`}),j0=S.forwardRef(({children:e,row:t=!0,flex:n=!0,gap:r=j.spacing.lg,p:o=j.spacing["2xl"],className:i,...s},a)=>C.jsx(G,{flex:n,row:t,gap:r,p:o,className:R.cx(q_,i),ref:a,...s,children:e}));j0.displayName="ModalFooter";const Ef=S.createContext({});function Rf(e){const t=S.useRef(null);return t.current===null&&(t.current=e()),t.current}const kf=typeof window<"u",V0=kf?S.useLayoutEffect:S.useEffect,jl=S.createContext(null);function Af(e,t){e.indexOf(t)===-1&&e.push(t)}function Mf(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const gr=(e,t,n)=>n>t?t:n<e?e:n;function Zu(e,t){return t?`${e}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${t}`:e}let Li=()=>{},pr=()=>{};process.env.NODE_ENV!=="production"&&(Li=(e,t,n)=>{!e&&typeof console<"u"&&console.warn(Zu(t,n))},pr=(e,t,n)=>{if(!e)throw new Error(Zu(t,n))});const mr={},B0=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function z0(e){return typeof e=="object"&&e!==null}const H0=e=>/^0[^.\s]+$/u.test(e);function Nf(e){let t;return()=>(t===void 0&&(t=e()),t)}const an=e=>e,Y_=(e,t)=>n=>t(e(n)),zs=(...e)=>e.reduce(Y_),ks=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r};class Pf{constructor(){this.subscriptions=[]}add(t){return Af(this.subscriptions,t),()=>Mf(this.subscriptions,t)}notify(t,n,r){const o=this.subscriptions.length;if(o)if(o===1)this.subscriptions[0](t,n,r);else for(let i=0;i<o;i++){const s=this.subscriptions[i];s&&s(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Cn=e=>e*1e3,sn=e=>e/1e3;function W0(e,t){return t?e*(1e3/t):0}const Bg=new Set;function Lf(e,t,n){e||Bg.has(t)||(console.warn(Zu(t,n)),Bg.add(t))}const K0=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,X_=1e-7,Z_=12;function J_(e,t,n,r,o){let i,s,a=0;do s=t+(n-t)/2,i=K0(s,r,o)-e,i>0?n=s:t=s;while(Math.abs(i)>X_&&++a<Z_);return s}function Hs(e,t,n,r){if(e===t&&n===r)return an;const o=i=>J_(i,0,1,e,n);return i=>i===0||i===1?i:K0(o(i),t,r)}const U0=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,G0=e=>t=>1-e(1-t),q0=Hs(.33,1.53,.69,.99),Ff=G0(q0),Y0=U0(Ff),X0=e=>(e*=2)<1?.5*Ff(e):.5*(2-Math.pow(2,-10*(e-1))),$f=e=>1-Math.sin(Math.acos(e)),Z0=G0($f),J0=U0($f),Q_=Hs(.42,0,1,1),eT=Hs(0,0,.58,1),Q0=Hs(.42,0,.58,1),tT=e=>Array.isArray(e)&&typeof e[0]!="number",ex=e=>Array.isArray(e)&&typeof e[0]=="number",zg={linear:an,easeIn:Q_,easeInOut:Q0,easeOut:eT,circIn:$f,circInOut:J0,circOut:Z0,backIn:Ff,backInOut:Y0,backOut:q0,anticipate:X0},nT=e=>typeof e=="string",Hg=e=>{if(ex(e)){pr(e.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[t,n,r,o]=e;return Hs(t,n,r,o)}else if(nT(e))return pr(zg[e]!==void 0,`Invalid easing type '${e}'`,"invalid-easing-type"),zg[e];return e},ga=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function rT(e,t){let n=new Set,r=new Set,o=!1,i=!1;const s=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function l(u){s.has(u)&&(c.schedule(u),e()),u(a)}const c={schedule:(u,f=!1,d=!1)=>{const g=d&&o?n:r;return f&&s.add(u),g.has(u)||g.add(u),u},cancel:u=>{r.delete(u),s.delete(u)},process:u=>{if(a=u,o){i=!0;return}o=!0,[n,r]=[r,n],n.forEach(l),n.clear(),o=!1,i&&(i=!1,c.process(u))}};return c}const oT=40;function tx(e,t){let n=!1,r=!0;const o={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,s=ga.reduce((v,b)=>(v[b]=rT(i),v),{}),{setup:a,read:l,resolveKeyframes:c,preUpdate:u,update:f,preRender:d,render:h,postRender:g}=s,p=()=>{const v=mr.useManualTiming?o.timestamp:performance.now();n=!1,mr.useManualTiming||(o.delta=r?1e3/60:Math.max(Math.min(v-o.timestamp,oT),1)),o.timestamp=v,o.isProcessing=!0,a.process(o),l.process(o),c.process(o),u.process(o),f.process(o),d.process(o),h.process(o),g.process(o),o.isProcessing=!1,n&&t&&(r=!1,e(p))},m=()=>{n=!0,r=!0,o.isProcessing||e(p)};return{schedule:ga.reduce((v,b)=>{const w=s[b];return v[b]=(_,E=!1,T=!1)=>(n||m(),w.schedule(_,E,T)),v},{}),cancel:v=>{for(let b=0;b<ga.length;b++)s[ga[b]].cancel(v)},state:o,steps:s}}const{schedule:Ue,cancel:Or,state:ht,steps:Ac}=tx(typeof requestAnimationFrame<"u"?requestAnimationFrame:an,!0);let Ka;function iT(){Ka=void 0}const Ot={now:()=>(Ka===void 0&&Ot.set(ht.isProcessing||mr.useManualTiming?ht.timestamp:performance.now()),Ka),set:e=>{Ka=e,queueMicrotask(iT)}},nx=e=>t=>typeof t=="string"&&t.startsWith(e),rx=nx("--"),sT=nx("var(--"),Of=e=>sT(e)?aT.test(e.split("/*")[0].trim()):!1,aT=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Fi={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},As={...Fi,transform:e=>gr(0,1,e)},pa={...Fi,default:1},ys=e=>Math.round(e*1e5)/1e5,If=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function lT(e){return e==null}const cT=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Df=(e,t)=>n=>!!(typeof n=="string"&&cT.test(n)&&n.startsWith(e)||t&&!lT(n)&&Object.prototype.hasOwnProperty.call(n,t)),ox=(e,t,n)=>r=>{if(typeof r!="string")return r;const[o,i,s,a]=r.match(If);return{[e]:parseFloat(o),[t]:parseFloat(i),[n]:parseFloat(s),alpha:a!==void 0?parseFloat(a):1}},uT=e=>gr(0,255,e),Mc={...Fi,transform:e=>Math.round(uT(e))},fo={test:Df("rgb","red"),parse:ox("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Mc.transform(e)+", "+Mc.transform(t)+", "+Mc.transform(n)+", "+ys(As.transform(r))+")"};function dT(e){let t="",n="",r="",o="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),o=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),o=e.substring(4,5),t+=t,n+=n,r+=r,o+=o),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:o?parseInt(o,16)/255:1}}const Ju={test:Df("#"),parse:dT,transform:fo.transform},Ws=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),_r=Ws("deg"),Vn=Ws("%"),he=Ws("px"),fT=Ws("vh"),hT=Ws("vw"),Wg={...Vn,parse:e=>Vn.parse(e)/100,transform:e=>Vn.transform(e*100)},si={test:Df("hsl","hue"),parse:ox("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Vn.transform(ys(t))+", "+Vn.transform(ys(n))+", "+ys(As.transform(r))+")"},nt={test:e=>fo.test(e)||Ju.test(e)||si.test(e),parse:e=>fo.test(e)?fo.parse(e):si.test(e)?si.parse(e):Ju.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?fo.transform(e):si.transform(e),getAnimatableNone:e=>{const t=nt.parse(e);return t.alpha=0,nt.transform(t)}},gT=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function pT(e){return isNaN(e)&&typeof e=="string"&&(e.match(If)?.length||0)+(e.match(gT)?.length||0)>0}const ix="number",sx="color",mT="var",yT="var(",Kg="${}",vT=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Ms(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},o=[];let i=0;const a=t.replace(vT,l=>(nt.test(l)?(r.color.push(i),o.push(sx),n.push(nt.parse(l))):l.startsWith(yT)?(r.var.push(i),o.push(mT),n.push(l)):(r.number.push(i),o.push(ix),n.push(parseFloat(l))),++i,Kg)).split(Kg);return{values:n,split:a,indexes:r,types:o}}function ax(e){return Ms(e).values}function lx(e){const{split:t,types:n}=Ms(e),r=t.length;return o=>{let i="";for(let s=0;s<r;s++)if(i+=t[s],o[s]!==void 0){const a=n[s];a===ix?i+=ys(o[s]):a===sx?i+=nt.transform(o[s]):i+=o[s]}return i}}const xT=e=>typeof e=="number"?0:nt.test(e)?nt.getAnimatableNone(e):e;function bT(e){const t=ax(e);return lx(e)(t.map(xT))}const Ir={test:pT,parse:ax,createTransformer:lx,getAnimatableNone:bT};function Nc(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function wT({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let o=0,i=0,s=0;if(!t)o=i=s=n;else{const a=n<.5?n*(1+t):n+t-n*t,l=2*n-a;o=Nc(l,a,e+1/3),i=Nc(l,a,e),s=Nc(l,a,e-1/3)}return{red:Math.round(o*255),green:Math.round(i*255),blue:Math.round(s*255),alpha:r}}function sl(e,t){return n=>n>0?t:e}const Ze=(e,t,n)=>e+(t-e)*n,Pc=(e,t,n)=>{const r=e*e,o=n*(t*t-r)+r;return o<0?0:Math.sqrt(o)},CT=[Ju,fo,si],ST=e=>CT.find(t=>t.test(e));function Ug(e){const t=ST(e);if(Li(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!t)return!1;let n=t.parse(e);return t===si&&(n=wT(n)),n}const Gg=(e,t)=>{const n=Ug(e),r=Ug(t);if(!n||!r)return sl(e,t);const o={...n};return i=>(o.red=Pc(n.red,r.red,i),o.green=Pc(n.green,r.green,i),o.blue=Pc(n.blue,r.blue,i),o.alpha=Ze(n.alpha,r.alpha,i),fo.transform(o))},Qu=new Set(["none","hidden"]);function _T(e,t){return Qu.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function TT(e,t){return n=>Ze(e,t,n)}function jf(e){return typeof e=="number"?TT:typeof e=="string"?Of(e)?sl:nt.test(e)?Gg:kT:Array.isArray(e)?cx:typeof e=="object"?nt.test(e)?Gg:ET:sl}function cx(e,t){const n=[...e],r=n.length,o=e.map((i,s)=>jf(i)(i,t[s]));return i=>{for(let s=0;s<r;s++)n[s]=o[s](i);return n}}function ET(e,t){const n={...e,...t},r={};for(const o in n)e[o]!==void 0&&t[o]!==void 0&&(r[o]=jf(e[o])(e[o],t[o]));return o=>{for(const i in r)n[i]=r[i](o);return n}}function RT(e,t){const n=[],r={color:0,var:0,number:0};for(let o=0;o<t.values.length;o++){const i=t.types[o],s=e.indexes[i][r[i]],a=e.values[s]??0;n[o]=a,r[i]++}return n}const kT=(e,t)=>{const n=Ir.createTransformer(t),r=Ms(e),o=Ms(t);return r.indexes.var.length===o.indexes.var.length&&r.indexes.color.length===o.indexes.color.length&&r.indexes.number.length>=o.indexes.number.length?Qu.has(e)&&!o.values.length||Qu.has(t)&&!r.values.length?_T(e,t):zs(cx(RT(r,o),o.values),n):(Li(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),sl(e,t))};function ux(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?Ze(e,t,n):jf(e)(e,t)}const AT=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>Ue.update(t,n),stop:()=>Or(t),now:()=>ht.isProcessing?ht.timestamp:Ot.now()}},dx=(e,t,n=10)=>{let r="";const o=Math.max(Math.round(t/n),2);for(let i=0;i<o;i++)r+=Math.round(e(i/(o-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},al=2e4;function Vf(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<al;)t+=n,r=e.next(t);return t>=al?1/0:t}function MT(e,t=100,n){const r=n({...e,keyframes:[0,t]}),o=Math.min(Vf(r),al);return{type:"keyframes",ease:i=>r.next(o*i).value/t,duration:sn(o)}}const NT=5;function fx(e,t,n){const r=Math.max(t-NT,0);return W0(n-e(r),t-r)}const Ye={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},Lc=.001;function PT({duration:e=Ye.duration,bounce:t=Ye.bounce,velocity:n=Ye.velocity,mass:r=Ye.mass}){let o,i;Li(e<=Cn(Ye.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let s=1-t;s=gr(Ye.minDamping,Ye.maxDamping,s),e=gr(Ye.minDuration,Ye.maxDuration,sn(e)),s<1?(o=c=>{const u=c*s,f=u*e,d=u-n,h=ed(c,s),g=Math.exp(-f);return Lc-d/h*g},i=c=>{const f=c*s*e,d=f*n+n,h=Math.pow(s,2)*Math.pow(c,2)*e,g=Math.exp(-f),p=ed(Math.pow(c,2),s);return(-o(c)+Lc>0?-1:1)*((d-h)*g)/p}):(o=c=>{const u=Math.exp(-c*e),f=(c-n)*e+1;return-Lc+u*f},i=c=>{const u=Math.exp(-c*e),f=(n-c)*(e*e);return u*f});const a=5/e,l=FT(o,i,a);if(e=Cn(e),isNaN(l))return{stiffness:Ye.stiffness,damping:Ye.damping,duration:e};{const c=Math.pow(l,2)*r;return{stiffness:c,damping:s*2*Math.sqrt(r*c),duration:e}}}const LT=12;function FT(e,t,n){let r=n;for(let o=1;o<LT;o++)r=r-e(r)/t(r);return r}function ed(e,t){return e*Math.sqrt(1-t*t)}const $T=["duration","bounce"],OT=["stiffness","damping","mass"];function qg(e,t){return t.some(n=>e[n]!==void 0)}function IT(e){let t={velocity:Ye.velocity,stiffness:Ye.stiffness,damping:Ye.damping,mass:Ye.mass,isResolvedFromDuration:!1,...e};if(!qg(e,OT)&&qg(e,$T))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),o=r*r,i=2*gr(.05,1,1-(e.bounce||0))*Math.sqrt(o);t={...t,mass:Ye.mass,stiffness:o,damping:i}}else{const n=PT(e);t={...t,...n,mass:Ye.mass},t.isResolvedFromDuration=!0}return t}function ll(e=Ye.visualDuration,t=Ye.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:o}=n;const i=n.keyframes[0],s=n.keyframes[n.keyframes.length-1],a={done:!1,value:i},{stiffness:l,damping:c,mass:u,duration:f,velocity:d,isResolvedFromDuration:h}=IT({...n,velocity:-sn(n.velocity||0)}),g=d||0,p=c/(2*Math.sqrt(l*u)),m=s-i,x=sn(Math.sqrt(l/u)),y=Math.abs(m)<5;r||(r=y?Ye.restSpeed.granular:Ye.restSpeed.default),o||(o=y?Ye.restDelta.granular:Ye.restDelta.default);let v;if(p<1){const w=ed(x,p);v=_=>{const E=Math.exp(-p*x*_);return s-E*((g+p*x*m)/w*Math.sin(w*_)+m*Math.cos(w*_))}}else if(p===1)v=w=>s-Math.exp(-x*w)*(m+(g+x*m)*w);else{const w=x*Math.sqrt(p*p-1);v=_=>{const E=Math.exp(-p*x*_),T=Math.min(w*_,300);return s-E*((g+p*x*m)*Math.sinh(T)+w*m*Math.cosh(T))/w}}const b={calculatedDuration:h&&f||null,next:w=>{const _=v(w);if(h)a.done=w>=f;else{let E=w===0?g:0;p<1&&(E=w===0?Cn(g):fx(v,w,_));const T=Math.abs(E)<=r,k=Math.abs(s-_)<=o;a.done=T&&k}return a.value=a.done?s:_,a},toString:()=>{const w=Math.min(Vf(b),al),_=dx(E=>b.next(w*E).value,w,30);return w+"ms "+_},toTransition:()=>{}};return b}ll.applyToOptions=e=>{const t=MT(e,100,ll);return e.ease=t.ease,e.duration=Cn(t.duration),e.type="keyframes",e};function td({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:o=10,bounceStiffness:i=500,modifyTarget:s,min:a,max:l,restDelta:c=.5,restSpeed:u}){const f=e[0],d={done:!1,value:f},h=T=>a!==void 0&&T<a||l!==void 0&&T>l,g=T=>a===void 0?l:l===void 0||Math.abs(a-T)<Math.abs(l-T)?a:l;let p=n*t;const m=f+p,x=s===void 0?m:s(m);x!==m&&(p=x-f);const y=T=>-p*Math.exp(-T/r),v=T=>x+y(T),b=T=>{const k=y(T),P=v(T);d.done=Math.abs(k)<=c,d.value=d.done?x:P};let w,_;const E=T=>{h(d.value)&&(w=T,_=ll({keyframes:[d.value,g(d.value)],velocity:fx(v,T,d.value),damping:o,stiffness:i,restDelta:c,restSpeed:u}))};return E(0),{calculatedDuration:null,next:T=>{let k=!1;return!_&&w===void 0&&(k=!0,b(T),E(T)),w!==void 0&&T>=w?_.next(T-w):(!k&&b(T),d)}}}function DT(e,t,n){const r=[],o=n||mr.mix||ux,i=e.length-1;for(let s=0;s<i;s++){let a=o(e[s],e[s+1]);if(t){const l=Array.isArray(t)?t[s]||an:t;a=zs(l,a)}r.push(a)}return r}function jT(e,t,{clamp:n=!0,ease:r,mixer:o}={}){const i=e.length;if(pr(i===t.length,"Both input and output ranges must be the same length","range-length"),i===1)return()=>t[0];if(i===2&&t[0]===t[1])return()=>t[1];const s=e[0]===e[1];e[0]>e[i-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=DT(t,r,o),l=a.length,c=u=>{if(s&&u<e[0])return t[0];let f=0;if(l>1)for(;f<e.length-2&&!(u<e[f+1]);f++);const d=ks(e[f],e[f+1],u);return a[f](d)};return n?u=>c(gr(e[0],e[i-1],u)):c}function VT(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const o=ks(0,t,r);e.push(Ze(n,1,o))}}function BT(e){const t=[0];return VT(t,e.length-1),t}function zT(e,t){return e.map(n=>n*t)}function HT(e,t){return e.map(()=>t||Q0).splice(0,e.length-1)}function ai({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const o=tT(r)?r.map(Hg):Hg(r),i={done:!1,value:t[0]},s=zT(n&&n.length===t.length?n:BT(t),e),a=jT(s,t,{ease:Array.isArray(o)?o:HT(t,o)});return{calculatedDuration:e,next:l=>(i.value=a(l),i.done=l>=e,i)}}const WT=e=>e!==null;function Bf(e,{repeat:t,repeatType:n="loop"},r,o=1){const i=e.filter(WT),a=o<0||t&&n!=="loop"&&t%2===1?0:i.length-1;return!a||r===void 0?i[a]:r}const KT={decay:td,inertia:td,tween:ai,keyframes:ai,spring:ll};function hx(e){typeof e.type=="string"&&(e.type=KT[e.type])}class zf{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,n){return this.finished.then(t,n)}}const UT=e=>e/100;class Hf extends zf{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:n}=this.options;n&&n.updatedAt!==Ot.now()&&this.tick(Ot.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;hx(t);const{type:n=ai,repeat:r=0,repeatDelay:o=0,repeatType:i,velocity:s=0}=t;let{keyframes:a}=t;const l=n||ai;process.env.NODE_ENV!=="production"&&l!==ai&&pr(a.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${a}`,"spring-two-frames"),l!==ai&&typeof a[0]!="number"&&(this.mixKeyframes=zs(UT,ux(a[0],a[1])),a=[0,100]);const c=l({...t,keyframes:a});i==="mirror"&&(this.mirroredGenerator=l({...t,keyframes:[...a].reverse(),velocity:-s})),c.calculatedDuration===null&&(c.calculatedDuration=Vf(c));const{calculatedDuration:u}=c;this.calculatedDuration=u,this.resolvedDuration=u+o,this.totalDuration=this.resolvedDuration*(r+1)-o,this.generator=c}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){const{generator:r,totalDuration:o,mixKeyframes:i,mirroredGenerator:s,resolvedDuration:a,calculatedDuration:l}=this;if(this.startTime===null)return r.next(0);const{delay:c=0,keyframes:u,repeat:f,repeatType:d,repeatDelay:h,type:g,onUpdate:p,finalKeyframe:m}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-o/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const x=this.currentTime-c*(this.playbackSpeed>=0?1:-1),y=this.playbackSpeed>=0?x<0:x>o;this.currentTime=Math.max(x,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=o);let v=this.currentTime,b=r;if(f){const T=Math.min(this.currentTime,o)/a;let k=Math.floor(T),P=T%1;!P&&T>=1&&(P=1),P===1&&k--,k=Math.min(k,f+1),k%2&&(d==="reverse"?(P=1-P,h&&(P-=h/a)):d==="mirror"&&(b=s)),v=gr(0,1,P)*a}const w=y?{done:!1,value:u[0]}:b.next(v);i&&(w.value=i(w.value));let{done:_}=w;!y&&l!==null&&(_=this.playbackSpeed>=0?this.currentTime>=o:this.currentTime<=0);const E=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&_);return E&&g!==td&&(w.value=Bf(u,this.options,m,this.speed)),p&&p(w.value),E&&this.finish(),w}then(t,n){return this.finished.then(t,n)}get duration(){return sn(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+sn(t)}get time(){return sn(this.currentTime)}set time(t){t=Cn(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(Ot.now());const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=sn(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=AT,startTime:n}=this.options;this.driver||(this.driver=t(o=>this.tick(o))),this.options.onPlay?.();const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=n??r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(Ot.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}function GT(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const ho=e=>e*180/Math.PI,nd=e=>{const t=ho(Math.atan2(e[1],e[0]));return rd(t)},qT={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:nd,rotateZ:nd,skewX:e=>ho(Math.atan(e[1])),skewY:e=>ho(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},rd=e=>(e=e%360,e<0&&(e+=360),e),Yg=nd,Xg=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),Zg=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),YT={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Xg,scaleY:Zg,scale:e=>(Xg(e)+Zg(e))/2,rotateX:e=>rd(ho(Math.atan2(e[6],e[5]))),rotateY:e=>rd(ho(Math.atan2(-e[2],e[0]))),rotateZ:Yg,rotate:Yg,skewX:e=>ho(Math.atan(e[4])),skewY:e=>ho(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function od(e){return e.includes("scale")?1:0}function id(e,t){if(!e||e==="none")return od(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,o;if(n)r=YT,o=n;else{const a=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=qT,o=a}if(!o)return od(t);const i=r[t],s=o[1].split(",").map(ZT);return typeof i=="function"?i(s):s[i]}const XT=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return id(n,t)};function ZT(e){return parseFloat(e.trim())}const $i=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Oi=new Set($i),Jg=e=>e===Fi||e===he,JT=new Set(["x","y","z"]),QT=$i.filter(e=>!JT.has(e));function eE(e){const t=[];return QT.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const mo={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>id(t,"x"),y:(e,{transform:t})=>id(t,"y")};mo.translateX=mo.x;mo.translateY=mo.y;const yo=new Set;let sd=!1,ad=!1,ld=!1;function gx(){if(ad){const e=Array.from(yo).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const o=eE(r);o.length&&(n.set(r,o),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const o=n.get(r);o&&o.forEach(([i,s])=>{r.getValue(i)?.set(s)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}ad=!1,sd=!1,yo.forEach(e=>e.complete(ld)),yo.clear()}function px(){yo.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(ad=!0)})}function tE(){ld=!0,px(),gx(),ld=!1}class Wf{constructor(t,n,r,o,i,s=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=o,this.element=i,this.isAsync=s}scheduleResolve(){this.state="scheduled",this.isAsync?(yo.add(this),sd||(sd=!0,Ue.read(px),Ue.resolveKeyframes(gx))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:o}=this;if(t[0]===null){const i=o?.get(),s=t[t.length-1];if(i!==void 0)t[0]=i;else if(r&&n){const a=r.readValue(n,s);a!=null&&(t[0]=a)}t[0]===void 0&&(t[0]=s),o&&i===void 0&&o.set(t[0])}GT(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),yo.delete(this)}cancel(){this.state==="scheduled"&&(yo.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const nE=e=>e.startsWith("--");function rE(e,t,n){nE(t)?e.style.setProperty(t,n):e.style[t]=n}const oE=Nf(()=>window.ScrollTimeline!==void 0),iE={};function sE(e,t){const n=Nf(e);return()=>iE[t]??n()}const mx=sE(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),ds=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Qg={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:ds([0,.65,.55,1]),circOut:ds([.55,0,1,.45]),backIn:ds([.31,.01,.66,-.59]),backOut:ds([.33,1.53,.69,.99])};function yx(e,t){if(e)return typeof e=="function"?mx()?dx(e,t):"ease-out":ex(e)?ds(e):Array.isArray(e)?e.map(n=>yx(n,t)||Qg.easeOut):Qg[e]}function aE(e,t,n,{delay:r=0,duration:o=300,repeat:i=0,repeatType:s="loop",ease:a="easeOut",times:l}={},c=void 0){const u={[t]:n};l&&(u.offset=l);const f=yx(a,o);Array.isArray(f)&&(u.easing=f);const d={delay:r,duration:o,easing:Array.isArray(f)?"linear":f,fill:"both",iterations:i+1,direction:s==="reverse"?"alternate":"normal"};return c&&(d.pseudoElement=c),e.animate(u,d)}function vx(e){return typeof e=="function"&&"applyToOptions"in e}function lE({type:e,...t}){return vx(e)&&mx()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class cE extends zf{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,!t)return;const{element:n,name:r,keyframes:o,pseudoElement:i,allowFlatten:s=!1,finalKeyframe:a,onComplete:l}=t;this.isPseudoElement=!!i,this.allowFlatten=s,this.options=t,pr(typeof t.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");const c=lE(t);this.animation=aE(n,r,o,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const u=Bf(o,this.options,a,this.speed);this.updateMotionValue?this.updateMotionValue(u):rE(n,r,u),this.animation.cancel()}l?.(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return sn(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+sn(t)}get time(){return sn(Number(this.animation.currentTime)||0)}set time(t){this.finishedTime=null,this.animation.currentTime=Cn(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(t){this.animation.startTime=t}attachTimeline({timeline:t,observe:n}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&oE()?(this.animation.timeline=t,an):n(this)}}const xx={anticipate:X0,backInOut:Y0,circInOut:J0};function uE(e){return e in xx}function dE(e){typeof e.ease=="string"&&uE(e.ease)&&(e.ease=xx[e.ease])}const ep=10;class fE extends cE{constructor(t){dE(t),hx(t),super(t),t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:r,onComplete:o,element:i,...s}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const a=new Hf({...s,autoplay:!1}),l=Cn(this.finishedTime??this.time);n.setWithVelocity(a.sample(l-ep).value,a.sample(l).value,ep),a.stop()}}const tp=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Ir.test(e)||e==="0")&&!e.startsWith("url("));function hE(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function gE(e,t,n,r){const o=e[0];if(o===null)return!1;if(t==="display"||t==="visibility")return!0;const i=e[e.length-1],s=tp(o,t),a=tp(i,t);return Li(s===a,`You are trying to animate ${t} from "${o}" to "${i}". "${s?i:o}" is not an animatable value.`,"value-not-animatable"),!s||!a?!1:hE(e)||(n==="spring"||vx(n))&&r}function cd(e){e.duration=0,e.type="keyframes"}const pE=new Set(["opacity","clipPath","filter","transform"]),mE=Nf(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function yE(e){const{motionValue:t,name:n,repeatDelay:r,repeatType:o,damping:i,type:s}=e;if(!(t?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:c}=t.owner.getProps();return mE()&&n&&pE.has(n)&&(n!=="transform"||!c)&&!l&&!r&&o!=="mirror"&&i!==0&&s!=="inertia"}const vE=40;class xE extends zf{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:o=0,repeatDelay:i=0,repeatType:s="loop",keyframes:a,name:l,motionValue:c,element:u,...f}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=Ot.now();const d={autoplay:t,delay:n,type:r,repeat:o,repeatDelay:i,repeatType:s,name:l,motionValue:c,element:u,...f},h=u?.KeyframeResolver||Wf;this.keyframeResolver=new h(a,(g,p,m)=>this.onKeyframesResolved(g,p,d,!m),l,c,u),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,n,r,o){this.keyframeResolver=void 0;const{name:i,type:s,velocity:a,delay:l,isHandoff:c,onUpdate:u}=r;this.resolvedAt=Ot.now(),gE(t,i,s,a)||((mr.instantAnimations||!l)&&u?.(Bf(t,r,n)),t[0]=t[t.length-1],cd(r),r.repeat=0);const d={startTime:o?this.resolvedAt?this.resolvedAt-this.createdAt>vE?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:t},h=!c&&yE(d)?new fE({...d,element:d.motionValue.owner.current}):new Hf(d);h.finished.then(()=>this.notifyFinished()).catch(an),this.pendingTimeline&&(this.stopTimeline=h.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=h}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),tE()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}const bE=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function wE(e){const t=bE.exec(e);if(!t)return[,];const[,n,r,o]=t;return[`--${n??r}`,o]}const CE=4;function bx(e,t,n=1){pr(n<=CE,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[r,o]=wE(e);if(!r)return;const i=window.getComputedStyle(t).getPropertyValue(r);if(i){const s=i.trim();return B0(s)?parseFloat(s):s}return Of(o)?bx(o,t,n+1):o}function Kf(e,t){return e?.[t]??e?.default??e}const wx=new Set(["width","height","top","left","right","bottom",...$i]),SE={test:e=>e==="auto",parse:e=>e},Cx=e=>t=>t.test(e),Sx=[Fi,he,Vn,_r,hT,fT,SE],np=e=>Sx.find(Cx(e));function _E(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||H0(e):!0}const TE=new Set(["brightness","contrast","saturate","opacity"]);function EE(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(If)||[];if(!r)return e;const o=n.replace(r,"");let i=TE.has(t)?1:0;return r!==n&&(i*=100),t+"("+i+o+")"}const RE=/\b([a-z-]*)\(.*?\)/gu,ud={...Ir,getAnimatableNone:e=>{const t=e.match(RE);return t?t.map(EE).join(" "):e}},rp={...Fi,transform:Math.round},kE={rotate:_r,rotateX:_r,rotateY:_r,rotateZ:_r,scale:pa,scaleX:pa,scaleY:pa,scaleZ:pa,skew:_r,skewX:_r,skewY:_r,distance:he,translateX:he,translateY:he,translateZ:he,x:he,y:he,z:he,perspective:he,transformPerspective:he,opacity:As,originX:Wg,originY:Wg,originZ:he},Uf={borderWidth:he,borderTopWidth:he,borderRightWidth:he,borderBottomWidth:he,borderLeftWidth:he,borderRadius:he,radius:he,borderTopLeftRadius:he,borderTopRightRadius:he,borderBottomRightRadius:he,borderBottomLeftRadius:he,width:he,maxWidth:he,height:he,maxHeight:he,top:he,right:he,bottom:he,left:he,padding:he,paddingTop:he,paddingRight:he,paddingBottom:he,paddingLeft:he,margin:he,marginTop:he,marginRight:he,marginBottom:he,marginLeft:he,backgroundPositionX:he,backgroundPositionY:he,...kE,zIndex:rp,fillOpacity:As,strokeOpacity:As,numOctaves:rp},AE={...Uf,color:nt,backgroundColor:nt,outlineColor:nt,fill:nt,stroke:nt,borderColor:nt,borderTopColor:nt,borderRightColor:nt,borderBottomColor:nt,borderLeftColor:nt,filter:ud,WebkitFilter:ud},_x=e=>AE[e];function Tx(e,t){let n=_x(e);return n!==ud&&(n=Ir),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const ME=new Set(["auto","none","0"]);function NE(e,t,n){let r=0,o;for(;r<e.length&&!o;){const i=e[r];typeof i=="string"&&!ME.has(i)&&Ms(i).values.length&&(o=e[r]),r++}if(o&&n)for(const i of t)e[i]=Tx(n,o)}class PE extends Wf{constructor(t,n,r,o,i){super(t,n,r,o,i,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let l=0;l<t.length;l++){let c=t[l];if(typeof c=="string"&&(c=c.trim(),Of(c))){const u=bx(c,n.current);u!==void 0&&(t[l]=u),l===t.length-1&&(this.finalKeyframe=c)}}if(this.resolveNoneKeyframes(),!wx.has(r)||t.length!==2)return;const[o,i]=t,s=np(o),a=np(i);if(s!==a)if(Jg(s)&&Jg(a))for(let l=0;l<t.length;l++){const c=t[l];typeof c=="string"&&(t[l]=parseFloat(c))}else mo[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let o=0;o<t.length;o++)(t[o]===null||_E(t[o]))&&r.push(o);r.length&&NE(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=mo[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const o=n[n.length-1];o!==void 0&&t.getValue(r,o).jump(o,!1)}measureEndState(){const{element:t,name:n,unresolvedKeyframes:r}=this;if(!t||!t.current)return;const o=t.getValue(n);o&&o.jump(this.measuredOrigin,!1);const i=r.length-1,s=r[i];r[i]=mo[n](t.measureViewportBox(),window.getComputedStyle(t.current)),s!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=s),this.removedTransforms?.length&&this.removedTransforms.forEach(([a,l])=>{t.getValue(a).set(l)}),this.resolveNoneKeyframes()}}function LE(e,t,n){if(e instanceof EventTarget)return[e];if(typeof e=="string"){let r=document;const o=n?.[e]??r.querySelectorAll(e);return o?Array.from(o):[]}return Array.from(e)}const Ex=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function Rx(e){return z0(e)&&"offsetHeight"in e}const op=30,FE=e=>!isNaN(parseFloat(e));class $E{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{const o=Ot.now();if(this.updatedAt!==o&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const i of this.dependents)i.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=Ot.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=FE(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return process.env.NODE_ENV!=="production"&&Lf(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new Pf);const r=this.events[t].add(n);return t==="change"?()=>{r(),Ue.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=Ot.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>op)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,op);return W0(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Si(e,t){return new $E(e,t)}const{schedule:Gf}=tx(queueMicrotask,!1),yn={x:!1,y:!1};function kx(){return yn.x||yn.y}function OE(e){return e==="x"||e==="y"?yn[e]?null:(yn[e]=!0,()=>{yn[e]=!1}):yn.x||yn.y?null:(yn.x=yn.y=!0,()=>{yn.x=yn.y=!1})}function Ax(e,t){const n=LE(e),r=new AbortController,o={passive:!0,...t,signal:r.signal};return[n,o,()=>r.abort()]}function ip(e){return!(e.pointerType==="touch"||kx())}function IE(e,t,n={}){const[r,o,i]=Ax(e,n),s=a=>{if(!ip(a))return;const{target:l}=a,c=t(l,a);if(typeof c!="function"||!l)return;const u=f=>{ip(f)&&(c(f),l.removeEventListener("pointerleave",u))};l.addEventListener("pointerleave",u,o)};return r.forEach(a=>{a.addEventListener("pointerenter",s,o)}),i}const Mx=(e,t)=>t?e===t?!0:Mx(e,t.parentElement):!1,qf=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,DE=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function jE(e){return DE.has(e.tagName)||e.tabIndex!==-1}const Ua=new WeakSet;function sp(e){return t=>{t.key==="Enter"&&e(t)}}function Fc(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const VE=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=sp(()=>{if(Ua.has(n))return;Fc(n,"down");const o=sp(()=>{Fc(n,"up")}),i=()=>Fc(n,"cancel");n.addEventListener("keyup",o,t),n.addEventListener("blur",i,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function ap(e){return qf(e)&&!kx()}function BE(e,t,n={}){const[r,o,i]=Ax(e,n),s=a=>{const l=a.currentTarget;if(!ap(a))return;Ua.add(l);const c=t(l,a),u=(h,g)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",d),Ua.has(l)&&Ua.delete(l),ap(h)&&typeof c=="function"&&c(h,{success:g})},f=h=>{u(h,l===window||l===document||n.useGlobalTarget||Mx(l,h.target))},d=h=>{u(h,!1)};window.addEventListener("pointerup",f,o),window.addEventListener("pointercancel",d,o)};return r.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",s,o),Rx(a)&&(a.addEventListener("focus",c=>VE(c,o)),!jE(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),i}function Nx(e){return z0(e)&&"ownerSVGElement"in e}function zE(e){return Nx(e)&&e.tagName==="svg"}const wt=e=>!!(e&&e.getVelocity),HE=[...Sx,nt,Ir],WE=e=>HE.find(Cx(e)),Yf=S.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function lp(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function KE(...e){return t=>{let n=!1;const r=e.map(o=>{const i=lp(o,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let o=0;o<r.length;o++){const i=r[o];typeof i=="function"?i():lp(e[o],null)}}}}function UE(...e){return M.useCallback(KE(...e),e)}class GE extends M.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const r=n.offsetParent,o=Rx(r)&&r.offsetWidth||0,i=this.props.sizeRef.current;i.height=n.offsetHeight||0,i.width=n.offsetWidth||0,i.top=n.offsetTop,i.left=n.offsetLeft,i.right=o-i.width-i.left}return null}componentDidUpdate(){}render(){return this.props.children}}function qE({children:e,isPresent:t,anchorX:n,root:r}){const o=S.useId(),i=S.useRef(null),s=S.useRef({width:0,height:0,top:0,left:0,right:0}),{nonce:a}=S.useContext(Yf),l=UE(i,e?.ref);return S.useInsertionEffect(()=>{const{width:c,height:u,top:f,left:d,right:h}=s.current;if(t||!i.current||!c||!u)return;const g=n==="left"?`left: ${d}`:`right: ${h}`;i.current.dataset.motionPopId=o;const p=document.createElement("style");a&&(p.nonce=a);const m=r??document.head;return m.appendChild(p),p.sheet&&p.sheet.insertRule(`
26
+ `,wa={overlay:T.css({backdropFilter:"blur(5px)"}),modal:T.css({animationDuration:"0.2s",animationTimingFunction:"ease-in-out",animationName:X_,maxWidth:`calc(100vw - ${V.spacing["3xl"]})`,maxHeight:`calc(100vh - ${V.spacing["7xl"]} - ${V.spacing["7xl"]})`,borderRadius:V.cornerRadius["2xl"],backgroundColor:V.color.fill.bgPrimary,boxShadow:`0 4px 20px 0 ${V.color.effect.shadowS}`,[vs.sm()]:{flex:1}}),closeButton:T.css({position:"absolute",zIndex:1,top:V.spacing.lg,right:V.spacing.lg}),size_lg:T.css({width:874}),size_md:T.css({width:650}),size_sm:T.css({width:426})},H0=S.forwardRef(({isOpen:e,onClose:t,overlayClassName:n,modalClassName:r,absoluteCloseButtonClassName:o,size:i="md",closeOnBackdropClick:s=!0,closeOnEsc:a=!0,disableBodyScroll:l=!0,showAbsoluteCloseButton:c,children:u},f)=>{S.useEffect(()=>{if(l&&e&&typeof window<"u"&&typeof document<"u"){const m=window.getComputedStyle(document.body).overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=m}}},[e,l]);const d=S.useCallback(m=>{m.key==="Escape"&&t()},[t]);S.useEffect(()=>{if(typeof window<"u"&&typeof document<"u"&&a&&e)return document.addEventListener("keydown",d),()=>document.removeEventListener("keydown",d)},[e,a,d]);const h=S.useRef(!1),g=S.useCallback(m=>{h.current=m.target===m.currentTarget},[]),p=S.useCallback(m=>{s&&m.target===m.currentTarget&&h.current&&t()},[s,t]);return e?C.jsx(ts,{children:C.jsx(z0.Provider,{value:{isOpen:e,onClose:t},children:C.jsx(q,{position:"fixed",top:0,right:0,bottom:0,left:0,row:!0,center:!0,flex:1,onMouseDown:g,onClick:p,backgroundColor:V.color.fill.bgOverlayPrimary,className:T.cx(wa.overlay,n),zIndex:1,children:C.jsxs(q,{ref:f,className:T.cx(wa.modal,wa[`size_${i}`],r),relative:!0,children:[c&&C.jsx(pr,{className:T.cx(wa.closeButton,o),onClick:t,color:"neutral",children:C.jsx(B0,{})}),u]})})})}):null});H0.displayName="Modal";const Z_=T.css({borderTop:`1px solid ${V.color.border.neutralAlphaBasic}`}),W0=S.forwardRef(({children:e,row:t=!0,flex:n=!0,gap:r=V.spacing.lg,p:o=V.spacing["2xl"],className:i,...s},a)=>C.jsx(q,{flex:n,row:t,gap:r,p:o,className:T.cx(Z_,i),ref:a,...s,children:e}));W0.displayName="ModalFooter";const Ff=S.createContext({});function $f(e){const t=S.useRef(null);return t.current===null&&(t.current=e()),t.current}const Of=typeof window<"u",K0=Of?S.useLayoutEffect:S.useEffect,Gl=S.createContext(null);function If(e,t){e.indexOf(t)===-1&&e.push(t)}function Df(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const yr=(e,t,n)=>n>t?t:n<e?e:n;function sd(e,t){return t?`${e}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${t}`:e}let Bi=()=>{},vr=()=>{};process.env.NODE_ENV!=="production"&&(Bi=(e,t,n)=>{!e&&typeof console<"u"&&console.warn(sd(t,n))},vr=(e,t,n)=>{if(!e)throw new Error(sd(t,n))});const xr={},U0=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function G0(e){return typeof e=="object"&&e!==null}const q0=e=>/^0[^.\s]+$/u.test(e);function jf(e){let t;return()=>(t===void 0&&(t=e()),t)}const cn=e=>e,J_=(e,t)=>n=>t(e(n)),Xs=(...e)=>e.reduce(J_),Os=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r};class Vf{constructor(){this.subscriptions=[]}add(t){return If(this.subscriptions,t),()=>Df(this.subscriptions,t)}notify(t,n,r){const o=this.subscriptions.length;if(o)if(o===1)this.subscriptions[0](t,n,r);else for(let i=0;i<o;i++){const s=this.subscriptions[i];s&&s(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Tn=e=>e*1e3,ln=e=>e/1e3;function Y0(e,t){return t?e*(1e3/t):0}const Wg=new Set;function Bf(e,t,n){e||Wg.has(t)||(console.warn(sd(t,n)),Wg.add(t))}const X0=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,Q_=1e-7,eT=12;function tT(e,t,n,r,o){let i,s,a=0;do s=t+(n-t)/2,i=X0(s,r,o)-e,i>0?n=s:t=s;while(Math.abs(i)>Q_&&++a<eT);return s}function Zs(e,t,n,r){if(e===t&&n===r)return cn;const o=i=>tT(i,0,1,e,n);return i=>i===0||i===1?i:X0(o(i),t,r)}const Z0=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,J0=e=>t=>1-e(1-t),Q0=Zs(.33,1.53,.69,.99),zf=J0(Q0),ex=Z0(zf),tx=e=>(e*=2)<1?.5*zf(e):.5*(2-Math.pow(2,-10*(e-1))),Hf=e=>1-Math.sin(Math.acos(e)),nx=J0(Hf),rx=Z0(Hf),nT=Zs(.42,0,1,1),rT=Zs(0,0,.58,1),ox=Zs(.42,0,.58,1),oT=e=>Array.isArray(e)&&typeof e[0]!="number",ix=e=>Array.isArray(e)&&typeof e[0]=="number",Kg={linear:cn,easeIn:nT,easeInOut:ox,easeOut:rT,circIn:Hf,circInOut:rx,circOut:nx,backIn:zf,backInOut:ex,backOut:Q0,anticipate:tx},iT=e=>typeof e=="string",Ug=e=>{if(ix(e)){vr(e.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[t,n,r,o]=e;return Zs(t,n,r,o)}else if(iT(e))return vr(Kg[e]!==void 0,`Invalid easing type '${e}'`,"invalid-easing-type"),Kg[e];return e},Ca=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function sT(e,t){let n=new Set,r=new Set,o=!1,i=!1;const s=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function l(u){s.has(u)&&(c.schedule(u),e()),u(a)}const c={schedule:(u,f=!1,d=!1)=>{const g=d&&o?n:r;return f&&s.add(u),g.has(u)||g.add(u),u},cancel:u=>{r.delete(u),s.delete(u)},process:u=>{if(a=u,o){i=!0;return}o=!0,[n,r]=[r,n],n.forEach(l),n.clear(),o=!1,i&&(i=!1,c.process(u))}};return c}const aT=40;function sx(e,t){let n=!1,r=!0;const o={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,s=Ca.reduce((x,b)=>(x[b]=sT(i),x),{}),{setup:a,read:l,resolveKeyframes:c,preUpdate:u,update:f,preRender:d,render:h,postRender:g}=s,p=()=>{const x=xr.useManualTiming?o.timestamp:performance.now();n=!1,xr.useManualTiming||(o.delta=r?1e3/60:Math.max(Math.min(x-o.timestamp,aT),1)),o.timestamp=x,o.isProcessing=!0,a.process(o),l.process(o),c.process(o),u.process(o),f.process(o),d.process(o),h.process(o),g.process(o),o.isProcessing=!1,n&&t&&(r=!1,e(p))},m=()=>{n=!0,r=!0,o.isProcessing||e(p)};return{schedule:Ca.reduce((x,b)=>{const w=s[b];return x[b]=(_,E=!1,R=!1)=>(n||m(),w.schedule(_,E,R)),x},{}),cancel:x=>{for(let b=0;b<Ca.length;b++)s[Ca[b]].cancel(x)},state:o,steps:s}}const{schedule:Ue,cancel:jr,state:mt,steps:Ic}=sx(typeof requestAnimationFrame<"u"?requestAnimationFrame:cn,!0);let Qa;function lT(){Qa=void 0}const jt={now:()=>(Qa===void 0&&jt.set(mt.isProcessing||xr.useManualTiming?mt.timestamp:performance.now()),Qa),set:e=>{Qa=e,queueMicrotask(lT)}},ax=e=>t=>typeof t=="string"&&t.startsWith(e),lx=ax("--"),cT=ax("var(--"),Wf=e=>cT(e)?uT.test(e.split("/*")[0].trim()):!1,uT=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,zi={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Is={...zi,transform:e=>yr(0,1,e)},Sa={...zi,default:1},Ts=e=>Math.round(e*1e5)/1e5,Kf=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function dT(e){return e==null}const fT=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Uf=(e,t)=>n=>!!(typeof n=="string"&&fT.test(n)&&n.startsWith(e)||t&&!dT(n)&&Object.prototype.hasOwnProperty.call(n,t)),cx=(e,t,n)=>r=>{if(typeof r!="string")return r;const[o,i,s,a]=r.match(Kf);return{[e]:parseFloat(o),[t]:parseFloat(i),[n]:parseFloat(s),alpha:a!==void 0?parseFloat(a):1}},hT=e=>yr(0,255,e),Dc={...zi,transform:e=>Math.round(hT(e))},xo={test:Uf("rgb","red"),parse:cx("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Dc.transform(e)+", "+Dc.transform(t)+", "+Dc.transform(n)+", "+Ts(Is.transform(r))+")"};function gT(e){let t="",n="",r="",o="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),o=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),o=e.substring(4,5),t+=t,n+=n,r+=r,o+=o),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:o?parseInt(o,16)/255:1}}const ad={test:Uf("#"),parse:gT,transform:xo.transform},Js=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Rr=Js("deg"),Hn=Js("%"),he=Js("px"),pT=Js("vh"),mT=Js("vw"),Gg={...Hn,parse:e=>Hn.parse(e)/100,transform:e=>Hn.transform(e*100)},pi={test:Uf("hsl","hue"),parse:cx("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Hn.transform(Ts(t))+", "+Hn.transform(Ts(n))+", "+Ts(Is.transform(r))+")"},it={test:e=>xo.test(e)||ad.test(e)||pi.test(e),parse:e=>xo.test(e)?xo.parse(e):pi.test(e)?pi.parse(e):ad.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?xo.transform(e):pi.transform(e),getAnimatableNone:e=>{const t=it.parse(e);return t.alpha=0,it.transform(t)}},yT=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function vT(e){return isNaN(e)&&typeof e=="string"&&(e.match(Kf)?.length||0)+(e.match(yT)?.length||0)>0}const ux="number",dx="color",xT="var",bT="var(",qg="${}",wT=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Ds(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},o=[];let i=0;const a=t.replace(wT,l=>(it.test(l)?(r.color.push(i),o.push(dx),n.push(it.parse(l))):l.startsWith(bT)?(r.var.push(i),o.push(xT),n.push(l)):(r.number.push(i),o.push(ux),n.push(parseFloat(l))),++i,qg)).split(qg);return{values:n,split:a,indexes:r,types:o}}function fx(e){return Ds(e).values}function hx(e){const{split:t,types:n}=Ds(e),r=t.length;return o=>{let i="";for(let s=0;s<r;s++)if(i+=t[s],o[s]!==void 0){const a=n[s];a===ux?i+=Ts(o[s]):a===dx?i+=it.transform(o[s]):i+=o[s]}return i}}const CT=e=>typeof e=="number"?0:it.test(e)?it.getAnimatableNone(e):e;function ST(e){const t=fx(e);return hx(e)(t.map(CT))}const Vr={test:vT,parse:fx,createTransformer:hx,getAnimatableNone:ST};function jc(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function _T({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let o=0,i=0,s=0;if(!t)o=i=s=n;else{const a=n<.5?n*(1+t):n+t-n*t,l=2*n-a;o=jc(l,a,e+1/3),i=jc(l,a,e),s=jc(l,a,e-1/3)}return{red:Math.round(o*255),green:Math.round(i*255),blue:Math.round(s*255),alpha:r}}function gl(e,t){return n=>n>0?t:e}const Je=(e,t,n)=>e+(t-e)*n,Vc=(e,t,n)=>{const r=e*e,o=n*(t*t-r)+r;return o<0?0:Math.sqrt(o)},TT=[ad,xo,pi],ET=e=>TT.find(t=>t.test(e));function Yg(e){const t=ET(e);if(Bi(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!t)return!1;let n=t.parse(e);return t===pi&&(n=_T(n)),n}const Xg=(e,t)=>{const n=Yg(e),r=Yg(t);if(!n||!r)return gl(e,t);const o={...n};return i=>(o.red=Vc(n.red,r.red,i),o.green=Vc(n.green,r.green,i),o.blue=Vc(n.blue,r.blue,i),o.alpha=Je(n.alpha,r.alpha,i),xo.transform(o))},ld=new Set(["none","hidden"]);function RT(e,t){return ld.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function kT(e,t){return n=>Je(e,t,n)}function Gf(e){return typeof e=="number"?kT:typeof e=="string"?Wf(e)?gl:it.test(e)?Xg:MT:Array.isArray(e)?gx:typeof e=="object"?it.test(e)?Xg:AT:gl}function gx(e,t){const n=[...e],r=n.length,o=e.map((i,s)=>Gf(i)(i,t[s]));return i=>{for(let s=0;s<r;s++)n[s]=o[s](i);return n}}function AT(e,t){const n={...e,...t},r={};for(const o in n)e[o]!==void 0&&t[o]!==void 0&&(r[o]=Gf(e[o])(e[o],t[o]));return o=>{for(const i in r)n[i]=r[i](o);return n}}function NT(e,t){const n=[],r={color:0,var:0,number:0};for(let o=0;o<t.values.length;o++){const i=t.types[o],s=e.indexes[i][r[i]],a=e.values[s]??0;n[o]=a,r[i]++}return n}const MT=(e,t)=>{const n=Vr.createTransformer(t),r=Ds(e),o=Ds(t);return r.indexes.var.length===o.indexes.var.length&&r.indexes.color.length===o.indexes.color.length&&r.indexes.number.length>=o.indexes.number.length?ld.has(e)&&!o.values.length||ld.has(t)&&!r.values.length?RT(e,t):Xs(gx(NT(r,o),o.values),n):(Bi(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),gl(e,t))};function px(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?Je(e,t,n):Gf(e)(e,t)}const PT=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>Ue.update(t,n),stop:()=>jr(t),now:()=>mt.isProcessing?mt.timestamp:jt.now()}},mx=(e,t,n=10)=>{let r="";const o=Math.max(Math.round(t/n),2);for(let i=0;i<o;i++)r+=Math.round(e(i/(o-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},pl=2e4;function qf(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<pl;)t+=n,r=e.next(t);return t>=pl?1/0:t}function LT(e,t=100,n){const r=n({...e,keyframes:[0,t]}),o=Math.min(qf(r),pl);return{type:"keyframes",ease:i=>r.next(o*i).value/t,duration:ln(o)}}const FT=5;function yx(e,t,n){const r=Math.max(t-FT,0);return Y0(n-e(r),t-r)}const Xe={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},Bc=.001;function $T({duration:e=Xe.duration,bounce:t=Xe.bounce,velocity:n=Xe.velocity,mass:r=Xe.mass}){let o,i;Bi(e<=Tn(Xe.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let s=1-t;s=yr(Xe.minDamping,Xe.maxDamping,s),e=yr(Xe.minDuration,Xe.maxDuration,ln(e)),s<1?(o=c=>{const u=c*s,f=u*e,d=u-n,h=cd(c,s),g=Math.exp(-f);return Bc-d/h*g},i=c=>{const f=c*s*e,d=f*n+n,h=Math.pow(s,2)*Math.pow(c,2)*e,g=Math.exp(-f),p=cd(Math.pow(c,2),s);return(-o(c)+Bc>0?-1:1)*((d-h)*g)/p}):(o=c=>{const u=Math.exp(-c*e),f=(c-n)*e+1;return-Bc+u*f},i=c=>{const u=Math.exp(-c*e),f=(n-c)*(e*e);return u*f});const a=5/e,l=IT(o,i,a);if(e=Tn(e),isNaN(l))return{stiffness:Xe.stiffness,damping:Xe.damping,duration:e};{const c=Math.pow(l,2)*r;return{stiffness:c,damping:s*2*Math.sqrt(r*c),duration:e}}}const OT=12;function IT(e,t,n){let r=n;for(let o=1;o<OT;o++)r=r-e(r)/t(r);return r}function cd(e,t){return e*Math.sqrt(1-t*t)}const DT=["duration","bounce"],jT=["stiffness","damping","mass"];function Zg(e,t){return t.some(n=>e[n]!==void 0)}function VT(e){let t={velocity:Xe.velocity,stiffness:Xe.stiffness,damping:Xe.damping,mass:Xe.mass,isResolvedFromDuration:!1,...e};if(!Zg(e,jT)&&Zg(e,DT))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),o=r*r,i=2*yr(.05,1,1-(e.bounce||0))*Math.sqrt(o);t={...t,mass:Xe.mass,stiffness:o,damping:i}}else{const n=$T(e);t={...t,...n,mass:Xe.mass},t.isResolvedFromDuration=!0}return t}function ml(e=Xe.visualDuration,t=Xe.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:o}=n;const i=n.keyframes[0],s=n.keyframes[n.keyframes.length-1],a={done:!1,value:i},{stiffness:l,damping:c,mass:u,duration:f,velocity:d,isResolvedFromDuration:h}=VT({...n,velocity:-ln(n.velocity||0)}),g=d||0,p=c/(2*Math.sqrt(l*u)),m=s-i,v=ln(Math.sqrt(l/u)),y=Math.abs(m)<5;r||(r=y?Xe.restSpeed.granular:Xe.restSpeed.default),o||(o=y?Xe.restDelta.granular:Xe.restDelta.default);let x;if(p<1){const w=cd(v,p);x=_=>{const E=Math.exp(-p*v*_);return s-E*((g+p*v*m)/w*Math.sin(w*_)+m*Math.cos(w*_))}}else if(p===1)x=w=>s-Math.exp(-v*w)*(m+(g+v*m)*w);else{const w=v*Math.sqrt(p*p-1);x=_=>{const E=Math.exp(-p*v*_),R=Math.min(w*_,300);return s-E*((g+p*v*m)*Math.sinh(R)+w*m*Math.cosh(R))/w}}const b={calculatedDuration:h&&f||null,next:w=>{const _=x(w);if(h)a.done=w>=f;else{let E=w===0?g:0;p<1&&(E=w===0?Tn(g):yx(x,w,_));const R=Math.abs(E)<=r,k=Math.abs(s-_)<=o;a.done=R&&k}return a.value=a.done?s:_,a},toString:()=>{const w=Math.min(qf(b),pl),_=mx(E=>b.next(w*E).value,w,30);return w+"ms "+_},toTransition:()=>{}};return b}ml.applyToOptions=e=>{const t=LT(e,100,ml);return e.ease=t.ease,e.duration=Tn(t.duration),e.type="keyframes",e};function ud({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:o=10,bounceStiffness:i=500,modifyTarget:s,min:a,max:l,restDelta:c=.5,restSpeed:u}){const f=e[0],d={done:!1,value:f},h=R=>a!==void 0&&R<a||l!==void 0&&R>l,g=R=>a===void 0?l:l===void 0||Math.abs(a-R)<Math.abs(l-R)?a:l;let p=n*t;const m=f+p,v=s===void 0?m:s(m);v!==m&&(p=v-f);const y=R=>-p*Math.exp(-R/r),x=R=>v+y(R),b=R=>{const k=y(R),M=x(R);d.done=Math.abs(k)<=c,d.value=d.done?v:M};let w,_;const E=R=>{h(d.value)&&(w=R,_=ml({keyframes:[d.value,g(d.value)],velocity:yx(x,R,d.value),damping:o,stiffness:i,restDelta:c,restSpeed:u}))};return E(0),{calculatedDuration:null,next:R=>{let k=!1;return!_&&w===void 0&&(k=!0,b(R),E(R)),w!==void 0&&R>=w?_.next(R-w):(!k&&b(R),d)}}}function BT(e,t,n){const r=[],o=n||xr.mix||px,i=e.length-1;for(let s=0;s<i;s++){let a=o(e[s],e[s+1]);if(t){const l=Array.isArray(t)?t[s]||cn:t;a=Xs(l,a)}r.push(a)}return r}function zT(e,t,{clamp:n=!0,ease:r,mixer:o}={}){const i=e.length;if(vr(i===t.length,"Both input and output ranges must be the same length","range-length"),i===1)return()=>t[0];if(i===2&&t[0]===t[1])return()=>t[1];const s=e[0]===e[1];e[0]>e[i-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=BT(t,r,o),l=a.length,c=u=>{if(s&&u<e[0])return t[0];let f=0;if(l>1)for(;f<e.length-2&&!(u<e[f+1]);f++);const d=Os(e[f],e[f+1],u);return a[f](d)};return n?u=>c(yr(e[0],e[i-1],u)):c}function HT(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const o=Os(0,t,r);e.push(Je(n,1,o))}}function WT(e){const t=[0];return HT(t,e.length-1),t}function KT(e,t){return e.map(n=>n*t)}function UT(e,t){return e.map(()=>t||ox).splice(0,e.length-1)}function mi({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const o=oT(r)?r.map(Ug):Ug(r),i={done:!1,value:t[0]},s=KT(n&&n.length===t.length?n:WT(t),e),a=zT(s,t,{ease:Array.isArray(o)?o:UT(t,o)});return{calculatedDuration:e,next:l=>(i.value=a(l),i.done=l>=e,i)}}const GT=e=>e!==null;function Yf(e,{repeat:t,repeatType:n="loop"},r,o=1){const i=e.filter(GT),a=o<0||t&&n!=="loop"&&t%2===1?0:i.length-1;return!a||r===void 0?i[a]:r}const qT={decay:ud,inertia:ud,tween:mi,keyframes:mi,spring:ml};function vx(e){typeof e.type=="string"&&(e.type=qT[e.type])}class Xf{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,n){return this.finished.then(t,n)}}const YT=e=>e/100;class Zf extends Xf{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:n}=this.options;n&&n.updatedAt!==jt.now()&&this.tick(jt.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;vx(t);const{type:n=mi,repeat:r=0,repeatDelay:o=0,repeatType:i,velocity:s=0}=t;let{keyframes:a}=t;const l=n||mi;process.env.NODE_ENV!=="production"&&l!==mi&&vr(a.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${a}`,"spring-two-frames"),l!==mi&&typeof a[0]!="number"&&(this.mixKeyframes=Xs(YT,px(a[0],a[1])),a=[0,100]);const c=l({...t,keyframes:a});i==="mirror"&&(this.mirroredGenerator=l({...t,keyframes:[...a].reverse(),velocity:-s})),c.calculatedDuration===null&&(c.calculatedDuration=qf(c));const{calculatedDuration:u}=c;this.calculatedDuration=u,this.resolvedDuration=u+o,this.totalDuration=this.resolvedDuration*(r+1)-o,this.generator=c}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){const{generator:r,totalDuration:o,mixKeyframes:i,mirroredGenerator:s,resolvedDuration:a,calculatedDuration:l}=this;if(this.startTime===null)return r.next(0);const{delay:c=0,keyframes:u,repeat:f,repeatType:d,repeatDelay:h,type:g,onUpdate:p,finalKeyframe:m}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-o/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const v=this.currentTime-c*(this.playbackSpeed>=0?1:-1),y=this.playbackSpeed>=0?v<0:v>o;this.currentTime=Math.max(v,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=o);let x=this.currentTime,b=r;if(f){const R=Math.min(this.currentTime,o)/a;let k=Math.floor(R),M=R%1;!M&&R>=1&&(M=1),M===1&&k--,k=Math.min(k,f+1),k%2&&(d==="reverse"?(M=1-M,h&&(M-=h/a)):d==="mirror"&&(b=s)),x=yr(0,1,M)*a}const w=y?{done:!1,value:u[0]}:b.next(x);i&&(w.value=i(w.value));let{done:_}=w;!y&&l!==null&&(_=this.playbackSpeed>=0?this.currentTime>=o:this.currentTime<=0);const E=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&_);return E&&g!==ud&&(w.value=Yf(u,this.options,m,this.speed)),p&&p(w.value),E&&this.finish(),w}then(t,n){return this.finished.then(t,n)}get duration(){return ln(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+ln(t)}get time(){return ln(this.currentTime)}set time(t){t=Tn(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(jt.now());const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=ln(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=PT,startTime:n}=this.options;this.driver||(this.driver=t(o=>this.tick(o))),this.options.onPlay?.();const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=n??r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(jt.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}function XT(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const bo=e=>e*180/Math.PI,dd=e=>{const t=bo(Math.atan2(e[1],e[0]));return fd(t)},ZT={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:dd,rotateZ:dd,skewX:e=>bo(Math.atan(e[1])),skewY:e=>bo(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},fd=e=>(e=e%360,e<0&&(e+=360),e),Jg=dd,Qg=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),ep=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),JT={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Qg,scaleY:ep,scale:e=>(Qg(e)+ep(e))/2,rotateX:e=>fd(bo(Math.atan2(e[6],e[5]))),rotateY:e=>fd(bo(Math.atan2(-e[2],e[0]))),rotateZ:Jg,rotate:Jg,skewX:e=>bo(Math.atan(e[4])),skewY:e=>bo(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function hd(e){return e.includes("scale")?1:0}function gd(e,t){if(!e||e==="none")return hd(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,o;if(n)r=JT,o=n;else{const a=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=ZT,o=a}if(!o)return hd(t);const i=r[t],s=o[1].split(",").map(eE);return typeof i=="function"?i(s):s[i]}const QT=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return gd(n,t)};function eE(e){return parseFloat(e.trim())}const Hi=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Wi=new Set(Hi),tp=e=>e===zi||e===he,tE=new Set(["x","y","z"]),nE=Hi.filter(e=>!tE.has(e));function rE(e){const t=[];return nE.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const So={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>gd(t,"x"),y:(e,{transform:t})=>gd(t,"y")};So.translateX=So.x;So.translateY=So.y;const _o=new Set;let pd=!1,md=!1,yd=!1;function xx(){if(md){const e=Array.from(_o).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const o=rE(r);o.length&&(n.set(r,o),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const o=n.get(r);o&&o.forEach(([i,s])=>{r.getValue(i)?.set(s)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}md=!1,pd=!1,_o.forEach(e=>e.complete(yd)),_o.clear()}function bx(){_o.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(md=!0)})}function oE(){yd=!0,bx(),xx(),yd=!1}class Jf{constructor(t,n,r,o,i,s=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=o,this.element=i,this.isAsync=s}scheduleResolve(){this.state="scheduled",this.isAsync?(_o.add(this),pd||(pd=!0,Ue.read(bx),Ue.resolveKeyframes(xx))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:o}=this;if(t[0]===null){const i=o?.get(),s=t[t.length-1];if(i!==void 0)t[0]=i;else if(r&&n){const a=r.readValue(n,s);a!=null&&(t[0]=a)}t[0]===void 0&&(t[0]=s),o&&i===void 0&&o.set(t[0])}XT(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),_o.delete(this)}cancel(){this.state==="scheduled"&&(_o.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const iE=e=>e.startsWith("--");function sE(e,t,n){iE(t)?e.style.setProperty(t,n):e.style[t]=n}const aE=jf(()=>window.ScrollTimeline!==void 0),lE={};function cE(e,t){const n=jf(e);return()=>lE[t]??n()}const wx=cE(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),xs=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,np={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:xs([0,.65,.55,1]),circOut:xs([.55,0,1,.45]),backIn:xs([.31,.01,.66,-.59]),backOut:xs([.33,1.53,.69,.99])};function Cx(e,t){if(e)return typeof e=="function"?wx()?mx(e,t):"ease-out":ix(e)?xs(e):Array.isArray(e)?e.map(n=>Cx(n,t)||np.easeOut):np[e]}function uE(e,t,n,{delay:r=0,duration:o=300,repeat:i=0,repeatType:s="loop",ease:a="easeOut",times:l}={},c=void 0){const u={[t]:n};l&&(u.offset=l);const f=Cx(a,o);Array.isArray(f)&&(u.easing=f);const d={delay:r,duration:o,easing:Array.isArray(f)?"linear":f,fill:"both",iterations:i+1,direction:s==="reverse"?"alternate":"normal"};return c&&(d.pseudoElement=c),e.animate(u,d)}function Sx(e){return typeof e=="function"&&"applyToOptions"in e}function dE({type:e,...t}){return Sx(e)&&wx()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class fE extends Xf{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,!t)return;const{element:n,name:r,keyframes:o,pseudoElement:i,allowFlatten:s=!1,finalKeyframe:a,onComplete:l}=t;this.isPseudoElement=!!i,this.allowFlatten=s,this.options=t,vr(typeof t.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");const c=dE(t);this.animation=uE(n,r,o,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const u=Yf(o,this.options,a,this.speed);this.updateMotionValue?this.updateMotionValue(u):sE(n,r,u),this.animation.cancel()}l?.(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return ln(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+ln(t)}get time(){return ln(Number(this.animation.currentTime)||0)}set time(t){this.finishedTime=null,this.animation.currentTime=Tn(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(t){this.animation.startTime=t}attachTimeline({timeline:t,observe:n}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&aE()?(this.animation.timeline=t,cn):n(this)}}const _x={anticipate:tx,backInOut:ex,circInOut:rx};function hE(e){return e in _x}function gE(e){typeof e.ease=="string"&&hE(e.ease)&&(e.ease=_x[e.ease])}const rp=10;class pE extends fE{constructor(t){gE(t),vx(t),super(t),t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:r,onComplete:o,element:i,...s}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const a=new Zf({...s,autoplay:!1}),l=Tn(this.finishedTime??this.time);n.setWithVelocity(a.sample(l-rp).value,a.sample(l).value,rp),a.stop()}}const op=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Vr.test(e)||e==="0")&&!e.startsWith("url("));function mE(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function yE(e,t,n,r){const o=e[0];if(o===null)return!1;if(t==="display"||t==="visibility")return!0;const i=e[e.length-1],s=op(o,t),a=op(i,t);return Bi(s===a,`You are trying to animate ${t} from "${o}" to "${i}". "${s?i:o}" is not an animatable value.`,"value-not-animatable"),!s||!a?!1:mE(e)||(n==="spring"||Sx(n))&&r}function vd(e){e.duration=0,e.type="keyframes"}const vE=new Set(["opacity","clipPath","filter","transform"]),xE=jf(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function bE(e){const{motionValue:t,name:n,repeatDelay:r,repeatType:o,damping:i,type:s}=e;if(!(t?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:c}=t.owner.getProps();return xE()&&n&&vE.has(n)&&(n!=="transform"||!c)&&!l&&!r&&o!=="mirror"&&i!==0&&s!=="inertia"}const wE=40;class CE extends Xf{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:o=0,repeatDelay:i=0,repeatType:s="loop",keyframes:a,name:l,motionValue:c,element:u,...f}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=jt.now();const d={autoplay:t,delay:n,type:r,repeat:o,repeatDelay:i,repeatType:s,name:l,motionValue:c,element:u,...f},h=u?.KeyframeResolver||Jf;this.keyframeResolver=new h(a,(g,p,m)=>this.onKeyframesResolved(g,p,d,!m),l,c,u),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,n,r,o){this.keyframeResolver=void 0;const{name:i,type:s,velocity:a,delay:l,isHandoff:c,onUpdate:u}=r;this.resolvedAt=jt.now(),yE(t,i,s,a)||((xr.instantAnimations||!l)&&u?.(Yf(t,r,n)),t[0]=t[t.length-1],vd(r),r.repeat=0);const d={startTime:o?this.resolvedAt?this.resolvedAt-this.createdAt>wE?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:t},h=!c&&bE(d)?new pE({...d,element:d.motionValue.owner.current}):new Zf(d);h.finished.then(()=>this.notifyFinished()).catch(cn),this.pendingTimeline&&(this.stopTimeline=h.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=h}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),oE()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}const SE=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function _E(e){const t=SE.exec(e);if(!t)return[,];const[,n,r,o]=t;return[`--${n??r}`,o]}const TE=4;function Tx(e,t,n=1){vr(n<=TE,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[r,o]=_E(e);if(!r)return;const i=window.getComputedStyle(t).getPropertyValue(r);if(i){const s=i.trim();return U0(s)?parseFloat(s):s}return Wf(o)?Tx(o,t,n+1):o}function Qf(e,t){return e?.[t]??e?.default??e}const Ex=new Set(["width","height","top","left","right","bottom",...Hi]),EE={test:e=>e==="auto",parse:e=>e},Rx=e=>t=>t.test(e),kx=[zi,he,Hn,Rr,mT,pT,EE],ip=e=>kx.find(Rx(e));function RE(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||q0(e):!0}const kE=new Set(["brightness","contrast","saturate","opacity"]);function AE(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(Kf)||[];if(!r)return e;const o=n.replace(r,"");let i=kE.has(t)?1:0;return r!==n&&(i*=100),t+"("+i+o+")"}const NE=/\b([a-z-]*)\(.*?\)/gu,xd={...Vr,getAnimatableNone:e=>{const t=e.match(NE);return t?t.map(AE).join(" "):e}},sp={...zi,transform:Math.round},ME={rotate:Rr,rotateX:Rr,rotateY:Rr,rotateZ:Rr,scale:Sa,scaleX:Sa,scaleY:Sa,scaleZ:Sa,skew:Rr,skewX:Rr,skewY:Rr,distance:he,translateX:he,translateY:he,translateZ:he,x:he,y:he,z:he,perspective:he,transformPerspective:he,opacity:Is,originX:Gg,originY:Gg,originZ:he},eh={borderWidth:he,borderTopWidth:he,borderRightWidth:he,borderBottomWidth:he,borderLeftWidth:he,borderRadius:he,radius:he,borderTopLeftRadius:he,borderTopRightRadius:he,borderBottomRightRadius:he,borderBottomLeftRadius:he,width:he,maxWidth:he,height:he,maxHeight:he,top:he,right:he,bottom:he,left:he,padding:he,paddingTop:he,paddingRight:he,paddingBottom:he,paddingLeft:he,margin:he,marginTop:he,marginRight:he,marginBottom:he,marginLeft:he,backgroundPositionX:he,backgroundPositionY:he,...ME,zIndex:sp,fillOpacity:Is,strokeOpacity:Is,numOctaves:sp},PE={...eh,color:it,backgroundColor:it,outlineColor:it,fill:it,stroke:it,borderColor:it,borderTopColor:it,borderRightColor:it,borderBottomColor:it,borderLeftColor:it,filter:xd,WebkitFilter:xd},Ax=e=>PE[e];function Nx(e,t){let n=Ax(e);return n!==xd&&(n=Vr),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const LE=new Set(["auto","none","0"]);function FE(e,t,n){let r=0,o;for(;r<e.length&&!o;){const i=e[r];typeof i=="string"&&!LE.has(i)&&Ds(i).values.length&&(o=e[r]),r++}if(o&&n)for(const i of t)e[i]=Nx(n,o)}class $E extends Jf{constructor(t,n,r,o,i){super(t,n,r,o,i,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let l=0;l<t.length;l++){let c=t[l];if(typeof c=="string"&&(c=c.trim(),Wf(c))){const u=Tx(c,n.current);u!==void 0&&(t[l]=u),l===t.length-1&&(this.finalKeyframe=c)}}if(this.resolveNoneKeyframes(),!Ex.has(r)||t.length!==2)return;const[o,i]=t,s=ip(o),a=ip(i);if(s!==a)if(tp(s)&&tp(a))for(let l=0;l<t.length;l++){const c=t[l];typeof c=="string"&&(t[l]=parseFloat(c))}else So[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let o=0;o<t.length;o++)(t[o]===null||RE(t[o]))&&r.push(o);r.length&&FE(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=So[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const o=n[n.length-1];o!==void 0&&t.getValue(r,o).jump(o,!1)}measureEndState(){const{element:t,name:n,unresolvedKeyframes:r}=this;if(!t||!t.current)return;const o=t.getValue(n);o&&o.jump(this.measuredOrigin,!1);const i=r.length-1,s=r[i];r[i]=So[n](t.measureViewportBox(),window.getComputedStyle(t.current)),s!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=s),this.removedTransforms?.length&&this.removedTransforms.forEach(([a,l])=>{t.getValue(a).set(l)}),this.resolveNoneKeyframes()}}function OE(e,t,n){if(e instanceof EventTarget)return[e];if(typeof e=="string"){let r=document;const o=n?.[e]??r.querySelectorAll(e);return o?Array.from(o):[]}return Array.from(e)}const Mx=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function Px(e){return G0(e)&&"offsetHeight"in e}const ap=30,IE=e=>!isNaN(parseFloat(e));class DE{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{const o=jt.now();if(this.updatedAt!==o&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const i of this.dependents)i.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=jt.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=IE(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return process.env.NODE_ENV!=="production"&&Bf(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new Vf);const r=this.events[t].add(n);return t==="change"?()=>{r(),Ue.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=jt.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>ap)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,ap);return Y0(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Pi(e,t){return new DE(e,t)}const{schedule:th}=sx(queueMicrotask,!1),bn={x:!1,y:!1};function Lx(){return bn.x||bn.y}function jE(e){return e==="x"||e==="y"?bn[e]?null:(bn[e]=!0,()=>{bn[e]=!1}):bn.x||bn.y?null:(bn.x=bn.y=!0,()=>{bn.x=bn.y=!1})}function Fx(e,t){const n=OE(e),r=new AbortController,o={passive:!0,...t,signal:r.signal};return[n,o,()=>r.abort()]}function lp(e){return!(e.pointerType==="touch"||Lx())}function VE(e,t,n={}){const[r,o,i]=Fx(e,n),s=a=>{if(!lp(a))return;const{target:l}=a,c=t(l,a);if(typeof c!="function"||!l)return;const u=f=>{lp(f)&&(c(f),l.removeEventListener("pointerleave",u))};l.addEventListener("pointerleave",u,o)};return r.forEach(a=>{a.addEventListener("pointerenter",s,o)}),i}const $x=(e,t)=>t?e===t?!0:$x(e,t.parentElement):!1,nh=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,BE=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function zE(e){return BE.has(e.tagName)||e.tabIndex!==-1}const el=new WeakSet;function cp(e){return t=>{t.key==="Enter"&&e(t)}}function zc(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const HE=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=cp(()=>{if(el.has(n))return;zc(n,"down");const o=cp(()=>{zc(n,"up")}),i=()=>zc(n,"cancel");n.addEventListener("keyup",o,t),n.addEventListener("blur",i,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function up(e){return nh(e)&&!Lx()}function WE(e,t,n={}){const[r,o,i]=Fx(e,n),s=a=>{const l=a.currentTarget;if(!up(a))return;el.add(l);const c=t(l,a),u=(h,g)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",d),el.has(l)&&el.delete(l),up(h)&&typeof c=="function"&&c(h,{success:g})},f=h=>{u(h,l===window||l===document||n.useGlobalTarget||$x(l,h.target))},d=h=>{u(h,!1)};window.addEventListener("pointerup",f,o),window.addEventListener("pointercancel",d,o)};return r.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",s,o),Px(a)&&(a.addEventListener("focus",c=>HE(c,o)),!zE(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),i}function Ox(e){return G0(e)&&"ownerSVGElement"in e}function KE(e){return Ox(e)&&e.tagName==="svg"}const St=e=>!!(e&&e.getVelocity),UE=[...kx,it,Vr],GE=e=>UE.find(Rx(e)),rh=S.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function dp(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function qE(...e){return t=>{let n=!1;const r=e.map(o=>{const i=dp(o,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let o=0;o<r.length;o++){const i=r[o];typeof i=="function"?i():dp(e[o],null)}}}}function YE(...e){return N.useCallback(qE(...e),e)}class XE extends N.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const r=n.offsetParent,o=Px(r)&&r.offsetWidth||0,i=this.props.sizeRef.current;i.height=n.offsetHeight||0,i.width=n.offsetWidth||0,i.top=n.offsetTop,i.left=n.offsetLeft,i.right=o-i.width-i.left}return null}componentDidUpdate(){}render(){return this.props.children}}function ZE({children:e,isPresent:t,anchorX:n,root:r}){const o=S.useId(),i=S.useRef(null),s=S.useRef({width:0,height:0,top:0,left:0,right:0}),{nonce:a}=S.useContext(rh),l=YE(i,e?.ref);return S.useInsertionEffect(()=>{const{width:c,height:u,top:f,left:d,right:h}=s.current;if(t||!i.current||!c||!u)return;const g=n==="left"?`left: ${d}`:`right: ${h}`;i.current.dataset.motionPopId=o;const p=document.createElement("style");a&&(p.nonce=a);const m=r??document.head;return m.appendChild(p),p.sheet&&p.sheet.insertRule(`
27
27
  [data-motion-pop-id="${o}"] {
28
28
  position: absolute !important;
29
29
  width: ${c}px !important;
@@ -31,66 +31,66 @@
31
31
  ${g}px !important;
32
32
  top: ${f}px !important;
33
33
  }
34
- `),()=>{m.contains(p)&&m.removeChild(p)}},[t]),C.jsx(GE,{isPresent:t,childRef:i,sizeRef:s,children:M.cloneElement(e,{ref:l})})}const YE=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:o,presenceAffectsLayout:i,mode:s,anchorX:a,root:l})=>{const c=Rf(XE),u=S.useId();let f=!0,d=S.useMemo(()=>(f=!1,{id:u,initial:t,isPresent:n,custom:o,onExitComplete:h=>{c.set(h,!0);for(const g of c.values())if(!g)return;r&&r()},register:h=>(c.set(h,!1),()=>c.delete(h))}),[n,c,r]);return i&&f&&(d={...d}),S.useMemo(()=>{c.forEach((h,g)=>c.set(g,!1))},[n]),M.useEffect(()=>{!n&&!c.size&&r&&r()},[n]),s==="popLayout"&&(e=C.jsx(qE,{isPresent:n,anchorX:a,root:l,children:e})),C.jsx(jl.Provider,{value:d,children:e})};function XE(){return new Map}function Px(e=!0){const t=S.useContext(jl);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:o}=t,i=S.useId();S.useEffect(()=>{if(e)return o(i)},[e]);const s=S.useCallback(()=>e&&r&&r(i),[i,r,e]);return!n&&r?[!1,s]:[!0]}const ma=e=>e.key||"";function cp(e){const t=[];return S.Children.forEach(e,n=>{S.isValidElement(n)&&t.push(n)}),t}const Lx=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:o=!0,mode:i="sync",propagate:s=!1,anchorX:a="left",root:l})=>{const[c,u]=Px(s),f=S.useMemo(()=>cp(e),[e]),d=s&&!c?[]:f.map(ma),h=S.useRef(!0),g=S.useRef(f),p=Rf(()=>new Map),[m,x]=S.useState(f),[y,v]=S.useState(f);V0(()=>{h.current=!1,g.current=f;for(let _=0;_<y.length;_++){const E=ma(y[_]);d.includes(E)?p.delete(E):p.get(E)!==!0&&p.set(E,!1)}},[y,d.length,d.join("-")]);const b=[];if(f!==m){let _=[...f];for(let E=0;E<y.length;E++){const T=y[E],k=ma(T);d.includes(k)||(_.splice(E,0,T),b.push(T))}return i==="wait"&&b.length&&(_=b),v(cp(_)),x(f),null}process.env.NODE_ENV!=="production"&&i==="wait"&&y.length>1&&console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);const{forceRender:w}=S.useContext(Ef);return C.jsx(C.Fragment,{children:y.map(_=>{const E=ma(_),T=s&&!c?!1:f===y||d.includes(E),k=()=>{if(p.has(E))p.set(E,!0);else return;let P=!0;p.forEach(O=>{O||(P=!1)}),P&&(w?.(),v(g.current),s&&u?.(),r&&r())};return C.jsx(YE,{isPresent:T,initial:!h.current||n?void 0:!1,custom:t,presenceAffectsLayout:o,mode:i,root:l,onExitComplete:T?void 0:k,anchorX:a,children:_},E)})})},Fx=S.createContext({strict:!1}),up={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},_i={};for(const e in up)_i[e]={isEnabled:t=>up[e].some(n=>!!t[n])};function ZE(e){for(const t in e)_i[t]={..._i[t],...e[t]}}const JE=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function cl(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||JE.has(e)}let $x=e=>!cl(e);function QE(e){typeof e=="function"&&($x=t=>t.startsWith("on")?!cl(t):e(t))}try{QE(require("@emotion/is-prop-valid").default)}catch{}function e2(e,t,n){const r={};for(const o in e)o==="values"&&typeof e.values=="object"||($x(o)||n===!0&&cl(o)||!t&&!cl(o)||e.draggable&&o.startsWith("onDrag"))&&(r[o]=e[o]);return r}const Vl=S.createContext({});function Bl(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function Ns(e){return typeof e=="string"||Array.isArray(e)}const Xf=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Zf=["initial",...Xf];function zl(e){return Bl(e.animate)||Zf.some(t=>Ns(e[t]))}function Ox(e){return!!(zl(e)||e.variants)}function t2(e,t){if(zl(e)){const{initial:n,animate:r}=e;return{initial:n===!1||Ns(n)?n:void 0,animate:Ns(r)?r:void 0}}return e.inherit!==!1?t:{}}function n2(e){const{initial:t,animate:n}=t2(e,S.useContext(Vl));return S.useMemo(()=>({initial:t,animate:n}),[dp(t),dp(n)])}function dp(e){return Array.isArray(e)?e.join(" "):e}function fp(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Ji={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(he.test(e))e=parseFloat(e);else return e;const n=fp(e,t.target.x),r=fp(e,t.target.y);return`${n}% ${r}%`}},r2={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,o=Ir.parse(e);if(o.length>5)return r;const i=Ir.createTransformer(e),s=typeof o[0]!="number"?1:0,a=n.x.scale*t.x,l=n.y.scale*t.y;o[0+s]/=a,o[1+s]/=l;const c=Ze(a,l,.5);return typeof o[2+s]=="number"&&(o[2+s]/=c),typeof o[3+s]=="number"&&(o[3+s]/=c),i(o)}},dd={borderRadius:{...Ji,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Ji,borderTopRightRadius:Ji,borderBottomLeftRadius:Ji,borderBottomRightRadius:Ji,boxShadow:r2};function Ix(e,{layout:t,layoutId:n}){return Oi.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!dd[e]||e==="opacity")}const o2={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},i2=$i.length;function s2(e,t,n){let r="",o=!0;for(let i=0;i<i2;i++){const s=$i[i],a=e[s];if(a===void 0)continue;let l=!0;if(typeof a=="number"?l=a===(s.startsWith("scale")?1:0):l=parseFloat(a)===0,!l||n){const c=Ex(a,Uf[s]);if(!l){o=!1;const u=o2[s]||s;r+=`${u}(${c}) `}n&&(t[s]=c)}}return r=r.trim(),n?r=n(t,o?"":r):o&&(r="none"),r}function Jf(e,t,n){const{style:r,vars:o,transformOrigin:i}=e;let s=!1,a=!1;for(const l in t){const c=t[l];if(Oi.has(l)){s=!0;continue}else if(rx(l)){o[l]=c;continue}else{const u=Ex(c,Uf[l]);l.startsWith("origin")?(a=!0,i[l]=u):r[l]=u}}if(t.transform||(s||n?r.transform=s2(t,e.transform,n):r.transform&&(r.transform="none")),a){const{originX:l="50%",originY:c="50%",originZ:u=0}=i;r.transformOrigin=`${l} ${c} ${u}`}}const Qf=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Dx(e,t,n){for(const r in t)!wt(t[r])&&!Ix(r,n)&&(e[r]=t[r])}function a2({transformTemplate:e},t){return S.useMemo(()=>{const n=Qf();return Jf(n,t,e),Object.assign({},n.vars,n.style)},[t])}function l2(e,t){const n=e.style||{},r={};return Dx(r,n,e),Object.assign(r,a2(e,t)),r}function c2(e,t){const n={},r=l2(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const u2={offset:"stroke-dashoffset",array:"stroke-dasharray"},d2={offset:"strokeDashoffset",array:"strokeDasharray"};function f2(e,t,n=1,r=0,o=!0){e.pathLength=1;const i=o?u2:d2;e[i.offset]=he.transform(-r);const s=he.transform(t),a=he.transform(n);e[i.array]=`${s} ${a}`}function jx(e,{attrX:t,attrY:n,attrScale:r,pathLength:o,pathSpacing:i=1,pathOffset:s=0,...a},l,c,u){if(Jf(e,a,c),l){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:f,style:d}=e;f.transform&&(d.transform=f.transform,delete f.transform),(d.transform||f.transformOrigin)&&(d.transformOrigin=f.transformOrigin??"50% 50%",delete f.transformOrigin),d.transform&&(d.transformBox=u?.transformBox??"fill-box",delete f.transformBox),t!==void 0&&(f.x=t),n!==void 0&&(f.y=n),r!==void 0&&(f.scale=r),o!==void 0&&f2(f,o,i,s,!1)}const Vx=()=>({...Qf(),attrs:{}}),Bx=e=>typeof e=="string"&&e.toLowerCase()==="svg";function h2(e,t,n,r){const o=S.useMemo(()=>{const i=Vx();return jx(i,t,Bx(r),e.transformTemplate,e.style),{...i.attrs,style:{...i.style}}},[t]);if(e.style){const i={};Dx(i,e.style,e),o.style={...i,...o.style}}return o}const g2=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function eh(e){return typeof e!="string"||e.includes("-")?!1:!!(g2.indexOf(e)>-1||/[A-Z]/u.test(e))}function p2(e,t,n,{latestValues:r},o,i=!1){const a=(eh(e)?h2:c2)(t,r,o,e),l=e2(t,typeof e=="string",i),c=e!==S.Fragment?{...l,...a,ref:n}:{},{children:u}=t,f=S.useMemo(()=>wt(u)?u.get():u,[u]);return S.createElement(e,{...c,children:f})}function hp(e){const t=[{},{}];return e?.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function th(e,t,n,r){if(typeof t=="function"){const[o,i]=hp(r);t=t(n!==void 0?n:e.custom,o,i)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[o,i]=hp(r);t=t(n!==void 0?n:e.custom,o,i)}return t}function Ga(e){return wt(e)?e.get():e}function m2({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,o){return{latestValues:y2(n,r,o,e),renderState:t()}}function y2(e,t,n,r){const o={},i=r(e,{});for(const d in i)o[d]=Ga(i[d]);let{initial:s,animate:a}=e;const l=zl(e),c=Ox(e);t&&c&&!l&&e.inherit!==!1&&(s===void 0&&(s=t.initial),a===void 0&&(a=t.animate));let u=n?n.initial===!1:!1;u=u||s===!1;const f=u?a:s;if(f&&typeof f!="boolean"&&!Bl(f)){const d=Array.isArray(f)?f:[f];for(let h=0;h<d.length;h++){const g=th(e,d[h]);if(g){const{transitionEnd:p,transition:m,...x}=g;for(const y in x){let v=x[y];if(Array.isArray(v)){const b=u?v.length-1:0;v=v[b]}v!==null&&(o[y]=v)}for(const y in p)o[y]=p[y]}}}return o}const zx=e=>(t,n)=>{const r=S.useContext(Vl),o=S.useContext(jl),i=()=>m2(e,t,r,o);return n?i():Rf(i)};function nh(e,t,n){const{style:r}=e,o={};for(const i in r)(wt(r[i])||t.style&&wt(t.style[i])||Ix(i,e)||n?.getValue(i)?.liveStyle!==void 0)&&(o[i]=r[i]);return o}const v2=zx({scrapeMotionValuesFromProps:nh,createRenderState:Qf});function Hx(e,t,n){const r=nh(e,t,n);for(const o in e)if(wt(e[o])||wt(t[o])){const i=$i.indexOf(o)!==-1?"attr"+o.charAt(0).toUpperCase()+o.substring(1):o;r[i]=e[o]}return r}const x2=zx({scrapeMotionValuesFromProps:Hx,createRenderState:Vx}),b2=Symbol.for("motionComponentSymbol");function li(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function w2(e,t,n){return S.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):li(n)&&(n.current=r))},[t])}const rh=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),C2="framerAppearId",Wx="data-"+rh(C2),Kx=S.createContext({});function S2(e,t,n,r,o){const{visualElement:i}=S.useContext(Vl),s=S.useContext(Fx),a=S.useContext(jl),l=S.useContext(Yf).reducedMotion,c=S.useRef(null);r=r||s.renderer,!c.current&&r&&(c.current=r(e,{visualState:t,parent:i,props:n,presenceContext:a,blockInitialAnimation:a?a.initial===!1:!1,reducedMotionConfig:l}));const u=c.current,f=S.useContext(Kx);u&&!u.projection&&o&&(u.type==="html"||u.type==="svg")&&_2(c.current,n,o,f);const d=S.useRef(!1);S.useInsertionEffect(()=>{u&&d.current&&u.update(n,a)});const h=n[Wx],g=S.useRef(!!h&&!window.MotionHandoffIsComplete?.(h)&&window.MotionHasOptimisedAnimation?.(h));return V0(()=>{u&&(d.current=!0,window.MotionIsMounted=!0,u.updateFeatures(),u.scheduleRenderMicrotask(),g.current&&u.animationState&&u.animationState.animateChanges())}),S.useEffect(()=>{u&&(!g.current&&u.animationState&&u.animationState.animateChanges(),g.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(h)}),g.current=!1),u.enteringChildren=void 0)}),u}function _2(e,t,n,r){const{layoutId:o,layout:i,drag:s,dragConstraints:a,layoutScroll:l,layoutRoot:c,layoutCrossfade:u}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:Ux(e.parent)),e.projection.setOptions({layoutId:o,layout:i,alwaysMeasureLayout:!!s||a&&li(a),visualElement:e,animationType:typeof i=="string"?i:"both",initialPromotionConfig:r,crossfade:u,layoutScroll:l,layoutRoot:c})}function Ux(e){if(e)return e.options.allowProjection!==!1?e.projection:Ux(e.parent)}function $c(e,{forwardMotionProps:t=!1}={},n,r){n&&ZE(n);const o=eh(e)?x2:v2;function i(a,l){let c;const u={...S.useContext(Yf),...a,layoutId:T2(a)},{isStatic:f}=u,d=n2(a),h=o(a,f);if(!f&&kf){E2(u,n);const g=R2(u);c=g.MeasureLayout,d.visualElement=S2(e,h,u,r,g.ProjectionNode)}return C.jsxs(Vl.Provider,{value:d,children:[c&&d.visualElement?C.jsx(c,{visualElement:d.visualElement,...u}):null,p2(e,a,w2(h,d.visualElement,l),h,f,t)]})}i.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const s=S.forwardRef(i);return s[b2]=e,s}function T2({layoutId:e}){const t=S.useContext(Ef).id;return t&&e!==void 0?t+"-"+e:e}function E2(e,t){const n=S.useContext(Fx).strict;if(process.env.NODE_ENV!=="production"&&t&&n){const r="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";e.ignoreStrict?Li(!1,r,"lazy-strict-mode"):pr(!1,r,"lazy-strict-mode")}}function R2(e){const{drag:t,layout:n}=_i;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function k2(e,t){if(typeof Proxy>"u")return $c;const n=new Map,r=(i,s)=>$c(i,s,e,t),o=(i,s)=>(process.env.NODE_ENV!=="production"&&Lf(!1,"motion() is deprecated. Use motion.create() instead."),r(i,s));return new Proxy(o,{get:(i,s)=>s==="create"?r:(n.has(s)||n.set(s,$c(s,void 0,e,t)),n.get(s))})}function Gx({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function A2({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function M2(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function Oc(e){return e===void 0||e===1}function fd({scale:e,scaleX:t,scaleY:n}){return!Oc(e)||!Oc(t)||!Oc(n)}function oo(e){return fd(e)||qx(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function qx(e){return gp(e.x)||gp(e.y)}function gp(e){return e&&e!=="0%"}function ul(e,t,n){const r=e-n,o=t*r;return n+o}function pp(e,t,n,r,o){return o!==void 0&&(e=ul(e,o,r)),ul(e,n,r)+t}function hd(e,t=0,n=1,r,o){e.min=pp(e.min,t,n,r,o),e.max=pp(e.max,t,n,r,o)}function Yx(e,{x:t,y:n}){hd(e.x,t.translate,t.scale,t.originPoint),hd(e.y,n.translate,n.scale,n.originPoint)}const mp=.999999999999,yp=1.0000000000001;function N2(e,t,n,r=!1){const o=n.length;if(!o)return;t.x=t.y=1;let i,s;for(let a=0;a<o;a++){i=n[a],s=i.projectionDelta;const{visualElement:l}=i.options;l&&l.props.style&&l.props.style.display==="contents"||(r&&i.options.layoutScroll&&i.scroll&&i!==i.root&&ui(e,{x:-i.scroll.offset.x,y:-i.scroll.offset.y}),s&&(t.x*=s.x.scale,t.y*=s.y.scale,Yx(e,s)),r&&oo(i.latestValues)&&ui(e,i.latestValues))}t.x<yp&&t.x>mp&&(t.x=1),t.y<yp&&t.y>mp&&(t.y=1)}function ci(e,t){e.min=e.min+t,e.max=e.max+t}function vp(e,t,n,r,o=.5){const i=Ze(e.min,e.max,o);hd(e,t,n,i,r)}function ui(e,t){vp(e.x,t.x,t.scaleX,t.scale,t.originX),vp(e.y,t.y,t.scaleY,t.scale,t.originY)}function Xx(e,t){return Gx(M2(e.getBoundingClientRect(),t))}function P2(e,t,n){const r=Xx(e,n),{scroll:o}=t;return o&&(ci(r.x,o.offset.x),ci(r.y,o.offset.y)),r}const xp=()=>({translate:0,scale:1,origin:0,originPoint:0}),di=()=>({x:xp(),y:xp()}),bp=()=>({min:0,max:0}),at=()=>({x:bp(),y:bp()}),gd={current:null},Zx={current:!1};function L2(){if(Zx.current=!0,!!kf)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>gd.current=e.matches;e.addEventListener("change",t),t()}else gd.current=!1}const F2=new WeakMap;function $2(e,t,n){for(const r in t){const o=t[r],i=n[r];if(wt(o))e.addValue(r,o);else if(wt(i))e.addValue(r,Si(o,{owner:e}));else if(i!==o)if(e.hasValue(r)){const s=e.getValue(r);s.liveStyle===!0?s.jump(o):s.hasAnimated||s.set(o)}else{const s=e.getStaticValue(r);e.addValue(r,Si(s!==void 0?s:o,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const wp=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class O2{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:o,blockInitialAnimation:i,visualState:s},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Wf,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const d=Ot.now();this.renderScheduledAt<d&&(this.renderScheduledAt=d,Ue.render(this.render,!1,!0))};const{latestValues:l,renderState:c}=s;this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},this.renderState=c,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=o,this.options=a,this.blockInitialAnimation=!!i,this.isControllingVariants=zl(n),this.isVariantNode=Ox(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:u,...f}=this.scrapeMotionValuesFromProps(n,{},this);for(const d in f){const h=f[d];l[d]!==void 0&&wt(h)&&h.set(l[d])}}mount(t){this.current=t,F2.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,r)=>this.bindToMotionValue(r,n)),Zx.current||L2(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:gd.current,process.env.NODE_ENV!=="production"&&Lf(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected.","reduced-motion-disabled"),this.parent?.addChild(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),Or(this.notifyUpdate),Or(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const r=Oi.has(t);r&&this.onBindTransform&&this.onBindTransform();const o=n.on("change",s=>{this.latestValues[t]=s,this.props.onUpdate&&Ue.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let i;window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{o(),i&&i(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in _i){const n=_i[t];if(!n)continue;const{isEnabled:r,Feature:o}=n;if(!this.features[t]&&o&&r(this.props)&&(this.features[t]=new o(this)),this.features[t]){const i=this.features[t];i.isMounted?i.update():(i.mount(),i.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):at()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<wp.length;r++){const o=wp[r];this.propEventSubscriptions[o]&&(this.propEventSubscriptions[o](),delete this.propEventSubscriptions[o]);const i="on"+o,s=t[i];s&&(this.propEventSubscriptions[o]=this.on(o,s))}this.prevMotionValues=$2(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=Si(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(B0(r)||H0(r))?r=parseFloat(r):!WE(r)&&Ir.test(n)&&(r=Tx(t,n)),this.setBaseTarget(t,wt(r)?r.get():r)),wt(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const i=th(this.props,n,this.presenceContext?.custom);i&&(r=i[t])}if(n&&r!==void 0)return r;const o=this.getBaseTargetFromProps(this.props,t);return o!==void 0&&!wt(o)?o:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Pf),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){Gf.render(this.render)}}class Jx extends O2{constructor(){super(...arguments),this.KeyframeResolver=PE}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;wt(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function Qx(e,{style:t,vars:n},r,o){const i=e.style;let s;for(s in t)i[s]=t[s];o?.applyProjectionStyles(i,r);for(s in n)i.setProperty(s,n[s])}function I2(e){return window.getComputedStyle(e)}class D2 extends Jx{constructor(){super(...arguments),this.type="html",this.renderInstance=Qx}readValueFromInstance(t,n){if(Oi.has(n))return this.projection?.isProjecting?od(n):XT(t,n);{const r=I2(t),o=(rx(n)?r.getPropertyValue(n):r[n])||0;return typeof o=="string"?o.trim():o}}measureInstanceViewportBox(t,{transformPagePoint:n}){return Xx(t,n)}build(t,n,r){Jf(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return nh(t,n,r)}}const e1=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function j2(e,t,n,r){Qx(e,t,void 0,r);for(const o in t.attrs)e.setAttribute(e1.has(o)?o:rh(o),t.attrs[o])}class V2 extends Jx{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=at}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Oi.has(n)){const r=_x(n);return r&&r.default||0}return n=e1.has(n)?n:rh(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return Hx(t,n,r)}build(t,n,r){jx(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,o){j2(t,n,r,o)}mount(t){this.isSVGTag=Bx(t.tagName),super.mount(t)}}const B2=(e,t)=>eh(e)?new V2(t):new D2(t,{allowProjection:e!==S.Fragment});function hi(e,t,n){const r=e.getProps();return th(r,t,n!==void 0?n:r.custom,e)}const pd=e=>Array.isArray(e);function z2(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Si(n))}function H2(e){return pd(e)?e[e.length-1]||0:e}function W2(e,t){const n=hi(e,t);let{transitionEnd:r={},transition:o={},...i}=n||{};i={...i,...r};for(const s in i){const a=H2(i[s]);z2(e,s,a)}}function K2(e){return!!(wt(e)&&e.add)}function md(e,t){const n=e.getValue("willChange");if(K2(n))return n.add(t);if(!n&&mr.WillChange){const r=new mr.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function t1(e){return e.props[Wx]}const U2=e=>e!==null;function G2(e,{repeat:t,repeatType:n="loop"},r){const o=e.filter(U2),i=t&&n!=="loop"&&t%2===1?0:o.length-1;return o[i]}const q2={type:"spring",stiffness:500,damping:25,restSpeed:10},Y2=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),X2={type:"keyframes",duration:.8},Z2={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},J2=(e,{keyframes:t})=>t.length>2?X2:Oi.has(e)?e.startsWith("scale")?Y2(t[1]):q2:Z2;function Q2({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:o,repeat:i,repeatType:s,repeatDelay:a,from:l,elapsed:c,...u}){return!!Object.keys(u).length}const oh=(e,t,n,r={},o,i)=>s=>{const a=Kf(r,e)||{},l=a.delay||r.delay||0;let{elapsed:c=0}=r;c=c-Cn(l);const u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-c,onUpdate:d=>{t.set(d),a.onUpdate&&a.onUpdate(d)},onComplete:()=>{s(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:i?void 0:o};Q2(a)||Object.assign(u,J2(e,u)),u.duration&&(u.duration=Cn(u.duration)),u.repeatDelay&&(u.repeatDelay=Cn(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let f=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(cd(u),u.delay===0&&(f=!0)),(mr.instantAnimations||mr.skipAnimations)&&(f=!0,cd(u),u.delay=0),u.allowFlatten=!a.type&&!a.ease,f&&!i&&t.get()!==void 0){const d=G2(u.keyframes,a);if(d!==void 0){Ue.update(()=>{u.onUpdate(d),u.onComplete()});return}}return a.isSync?new Hf(u):new xE(u)};function eR({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function n1(e,t,{delay:n=0,transitionOverride:r,type:o}={}){let{transition:i=e.getDefaultTransition(),transitionEnd:s,...a}=t;r&&(i=r);const l=[],c=o&&e.animationState&&e.animationState.getState()[o];for(const u in a){const f=e.getValue(u,e.latestValues[u]??null),d=a[u];if(d===void 0||c&&eR(c,u))continue;const h={delay:n,...Kf(i||{},u)},g=f.get();if(g!==void 0&&!f.isAnimating&&!Array.isArray(d)&&d===g&&!h.velocity)continue;let p=!1;if(window.MotionHandoffAnimation){const x=t1(e);if(x){const y=window.MotionHandoffAnimation(x,u,Ue);y!==null&&(h.startTime=y,p=!0)}}md(e,u),f.start(oh(u,f,d,e.shouldReduceMotion&&wx.has(u)?{type:!1}:h,e,p));const m=f.animation;m&&l.push(m)}return s&&Promise.all(l).then(()=>{Ue.update(()=>{s&&W2(e,s)})}),l}function r1(e,t,n,r=0,o=1){const i=Array.from(e).sort((c,u)=>c.sortNodePosition(u)).indexOf(t),s=e.size,a=(s-1)*r;return typeof n=="function"?n(i,s):o===1?i*r:a-i*r}function yd(e,t,n={}){const r=hi(e,t,n.type==="exit"?e.presenceContext?.custom:void 0);let{transition:o=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(o=n.transitionOverride);const i=r?()=>Promise.all(n1(e,r,n)):()=>Promise.resolve(),s=e.variantChildren&&e.variantChildren.size?(l=0)=>{const{delayChildren:c=0,staggerChildren:u,staggerDirection:f}=o;return tR(e,t,l,c,u,f,n)}:()=>Promise.resolve(),{when:a}=o;if(a){const[l,c]=a==="beforeChildren"?[i,s]:[s,i];return l().then(()=>c())}else return Promise.all([i(),s(n.delay)])}function tR(e,t,n=0,r=0,o=0,i=1,s){const a=[];for(const l of e.variantChildren)l.notify("AnimationStart",t),a.push(yd(l,t,{...s,delay:n+(typeof r=="function"?0:r)+r1(e.variantChildren,l,r,o,i)}).then(()=>l.notify("AnimationComplete",t)));return Promise.all(a)}function nR(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const o=t.map(i=>yd(e,i,n));r=Promise.all(o)}else if(typeof t=="string")r=yd(e,t,n);else{const o=typeof t=="function"?hi(e,t,n.custom):t;r=Promise.all(n1(e,o,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}function o1(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const rR=Zf.length;function i1(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?i1(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<rR;n++){const r=Zf[n],o=e.props[r];(Ns(o)||o===!1)&&(t[r]=o)}return t}const oR=[...Xf].reverse(),iR=Xf.length;function sR(e){return t=>Promise.all(t.map(({animation:n,options:r})=>nR(e,n,r)))}function aR(e){let t=sR(e),n=Cp(),r=!0;const o=l=>(c,u)=>{const f=hi(e,u,l==="exit"?e.presenceContext?.custom:void 0);if(f){const{transition:d,transitionEnd:h,...g}=f;c={...c,...g,...h}}return c};function i(l){t=l(e)}function s(l){const{props:c}=e,u=i1(e.parent)||{},f=[],d=new Set;let h={},g=1/0;for(let m=0;m<iR;m++){const x=oR[m],y=n[x],v=c[x]!==void 0?c[x]:u[x],b=Ns(v),w=x===l?y.isActive:null;w===!1&&(g=m);let _=v===u[x]&&v!==c[x]&&b;if(_&&r&&e.manuallyAnimateOnMount&&(_=!1),y.protectedKeys={...h},!y.isActive&&w===null||!v&&!y.prevProp||Bl(v)||typeof v=="boolean")continue;const E=lR(y.prevProp,v);let T=E||x===l&&y.isActive&&!_&&b||m>g&&b,k=!1;const P=Array.isArray(v)?v:[v];let O=P.reduce(o(x),{});w===!1&&(O={});const{prevResolvedValues:D={}}=y,I={...D,...O},$=L=>{T=!0,d.has(L)&&(k=!0,d.delete(L)),y.needsAnimating[L]=!0;const N=e.getValue(L);N&&(N.liveStyle=!1)};for(const L in I){const N=O[L],V=D[L];if(h.hasOwnProperty(L))continue;let K=!1;pd(N)&&pd(V)?K=!o1(N,V):K=N!==V,K?N!=null?$(L):d.add(L):N!==void 0&&d.has(L)?$(L):y.protectedKeys[L]=!0}y.prevProp=v,y.prevResolvedValues=O,y.isActive&&(h={...h,...O}),r&&e.blockInitialAnimation&&(T=!1);const H=_&&E;T&&(!H||k)&&f.push(...P.map(L=>{const N={type:x};if(typeof L=="string"&&r&&!H&&e.manuallyAnimateOnMount&&e.parent){const{parent:V}=e,K=hi(V,L);if(V.enteringChildren&&K){const{delayChildren:te}=K.transition||{};N.delay=r1(V.enteringChildren,e,te)}}return{animation:L,options:N}}))}if(d.size){const m={};if(typeof c.initial!="boolean"){const x=hi(e,Array.isArray(c.initial)?c.initial[0]:c.initial);x&&x.transition&&(m.transition=x.transition)}d.forEach(x=>{const y=e.getBaseTarget(x),v=e.getValue(x);v&&(v.liveStyle=!0),m[x]=y??null}),f.push({animation:m})}let p=!!f.length;return r&&(c.initial===!1||c.initial===c.animate)&&!e.manuallyAnimateOnMount&&(p=!1),r=!1,p?t(f):Promise.resolve()}function a(l,c){if(n[l].isActive===c)return Promise.resolve();e.variantChildren?.forEach(f=>f.animationState?.setActive(l,c)),n[l].isActive=c;const u=s(l);for(const f in n)n[f].protectedKeys={};return u}return{animateChanges:s,setActive:a,setAnimateFunction:i,getState:()=>n,reset:()=>{n=Cp()}}}function lR(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!o1(t,e):!1}function eo(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Cp(){return{animate:eo(!0),whileInView:eo(),whileHover:eo(),whileTap:eo(),whileDrag:eo(),whileFocus:eo(),exit:eo()}}class Gr{constructor(t){this.isMounted=!1,this.node=t}update(){}}class cR extends Gr{constructor(t){super(t),t.animationState||(t.animationState=aR(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Bl(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let uR=0;class dR extends Gr{constructor(){super(...arguments),this.id=uR++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const o=this.node.animationState.setActive("exit",!t);n&&!t&&o.then(()=>{n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const fR={animation:{Feature:cR},exit:{Feature:dR}};function Ps(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function Ks(e){return{point:{x:e.pageX,y:e.pageY}}}const hR=e=>t=>qf(t)&&e(t,Ks(t));function vs(e,t,n,r){return Ps(e,t,hR(n),r)}const s1=1e-4,gR=1-s1,pR=1+s1,a1=.01,mR=0-a1,yR=0+a1;function At(e){return e.max-e.min}function vR(e,t,n){return Math.abs(e-t)<=n}function Sp(e,t,n,r=.5){e.origin=r,e.originPoint=Ze(t.min,t.max,e.origin),e.scale=At(n)/At(t),e.translate=Ze(n.min,n.max,e.origin)-e.originPoint,(e.scale>=gR&&e.scale<=pR||isNaN(e.scale))&&(e.scale=1),(e.translate>=mR&&e.translate<=yR||isNaN(e.translate))&&(e.translate=0)}function xs(e,t,n,r){Sp(e.x,t.x,n.x,r?r.originX:void 0),Sp(e.y,t.y,n.y,r?r.originY:void 0)}function _p(e,t,n){e.min=n.min+t.min,e.max=e.min+At(t)}function xR(e,t,n){_p(e.x,t.x,n.x),_p(e.y,t.y,n.y)}function Tp(e,t,n){e.min=t.min-n.min,e.max=e.min+At(t)}function dl(e,t,n){Tp(e.x,t.x,n.x),Tp(e.y,t.y,n.y)}function rn(e){return[e("x"),e("y")]}const l1=({current:e})=>e?e.ownerDocument.defaultView:null,Ep=(e,t)=>Math.abs(e-t);function bR(e,t){const n=Ep(e.x,t.x),r=Ep(e.y,t.y);return Math.sqrt(n**2+r**2)}class c1{constructor(t,n,{transformPagePoint:r,contextWindow:o=window,dragSnapToOrigin:i=!1,distanceThreshold:s=3}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const d=Dc(this.lastMoveEventInfo,this.history),h=this.startEvent!==null,g=bR(d.offset,{x:0,y:0})>=this.distanceThreshold;if(!h&&!g)return;const{point:p}=d,{timestamp:m}=ht;this.history.push({...p,timestamp:m});const{onStart:x,onMove:y}=this.handlers;h||(x&&x(this.lastMoveEvent,d),this.startEvent=this.lastMoveEvent),y&&y(this.lastMoveEvent,d)},this.handlePointerMove=(d,h)=>{this.lastMoveEvent=d,this.lastMoveEventInfo=Ic(h,this.transformPagePoint),Ue.update(this.updatePoint,!0)},this.handlePointerUp=(d,h)=>{this.end();const{onEnd:g,onSessionEnd:p,resumeAnimation:m}=this.handlers;if(this.dragSnapToOrigin&&m&&m(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const x=Dc(d.type==="pointercancel"?this.lastMoveEventInfo:Ic(h,this.transformPagePoint),this.history);this.startEvent&&g&&g(d,x),p&&p(d,x)},!qf(t))return;this.dragSnapToOrigin=i,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=s,this.contextWindow=o||window;const a=Ks(t),l=Ic(a,this.transformPagePoint),{point:c}=l,{timestamp:u}=ht;this.history=[{...c,timestamp:u}];const{onSessionStart:f}=n;f&&f(t,Dc(l,this.history)),this.removeListeners=zs(vs(this.contextWindow,"pointermove",this.handlePointerMove),vs(this.contextWindow,"pointerup",this.handlePointerUp),vs(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Or(this.updatePoint)}}function Ic(e,t){return t?{point:t(e.point)}:e}function Rp(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Dc({point:e},t){return{point:e,delta:Rp(e,u1(t)),offset:Rp(e,wR(t)),velocity:CR(t,.1)}}function wR(e){return e[0]}function u1(e){return e[e.length-1]}function CR(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const o=u1(e);for(;n>=0&&(r=e[n],!(o.timestamp-r.timestamp>Cn(t)));)n--;if(!r)return{x:0,y:0};const i=sn(o.timestamp-r.timestamp);if(i===0)return{x:0,y:0};const s={x:(o.x-r.x)/i,y:(o.y-r.y)/i};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}function SR(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?Ze(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?Ze(n,e,r.max):Math.min(e,n)),e}function kp(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function _R(e,{top:t,left:n,bottom:r,right:o}){return{x:kp(e.x,n,o),y:kp(e.y,t,r)}}function Ap(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function TR(e,t){return{x:Ap(e.x,t.x),y:Ap(e.y,t.y)}}function ER(e,t){let n=.5;const r=At(e),o=At(t);return o>r?n=ks(t.min,t.max-r,e.min):r>o&&(n=ks(e.min,e.max-o,t.min)),gr(0,1,n)}function RR(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const vd=.35;function kR(e=vd){return e===!1?e=0:e===!0&&(e=vd),{x:Mp(e,"left","right"),y:Mp(e,"top","bottom")}}function Mp(e,t,n){return{min:Np(e,t),max:Np(e,n)}}function Np(e,t){return typeof e=="number"?e:e[t]||0}const AR=new WeakMap;class MR{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=at(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:o}=this.visualElement;if(o&&o.isPresent===!1)return;const i=f=>{const{dragSnapToOrigin:d}=this.getProps();d?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(Ks(f).point)},s=(f,d)=>{const{drag:h,dragPropagation:g,onDragStart:p}=this.getProps();if(h&&!g&&(this.openDragLock&&this.openDragLock(),this.openDragLock=OE(h),!this.openDragLock))return;this.latestPointerEvent=f,this.latestPanInfo=d,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),rn(x=>{let y=this.getAxisMotionValue(x).get()||0;if(Vn.test(y)){const{projection:v}=this.visualElement;if(v&&v.layout){const b=v.layout.layoutBox[x];b&&(y=At(b)*(parseFloat(y)/100))}}this.originPoint[x]=y}),p&&Ue.postRender(()=>p(f,d)),md(this.visualElement,"transform");const{animationState:m}=this.visualElement;m&&m.setActive("whileDrag",!0)},a=(f,d)=>{this.latestPointerEvent=f,this.latestPanInfo=d;const{dragPropagation:h,dragDirectionLock:g,onDirectionLock:p,onDrag:m}=this.getProps();if(!h&&!this.openDragLock)return;const{offset:x}=d;if(g&&this.currentDirection===null){this.currentDirection=NR(x),this.currentDirection!==null&&p&&p(this.currentDirection);return}this.updateAxis("x",d.point,x),this.updateAxis("y",d.point,x),this.visualElement.render(),m&&m(f,d)},l=(f,d)=>{this.latestPointerEvent=f,this.latestPanInfo=d,this.stop(f,d),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>rn(f=>this.getAnimationState(f)==="paused"&&this.getAxisMotionValue(f).animation?.play()),{dragSnapToOrigin:u}=this.getProps();this.panSession=new c1(t,{onSessionStart:i,onStart:s,onMove:a,onSessionEnd:l,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,distanceThreshold:r,contextWindow:l1(this.visualElement)})}stop(t,n){const r=t||this.latestPointerEvent,o=n||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!o||!r)return;const{velocity:s}=o;this.startAnimation(s);const{onDragEnd:a}=this.getProps();a&&Ue.postRender(()=>a(r,o))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:o}=this.getProps();if(!r||!ya(t,o,this.currentDirection))return;const i=this.getAxisMotionValue(t);let s=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(s=SR(s,this.constraints[t],this.elastic[t])),i.set(s)}resolveConstraints(){const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,o=this.constraints;t&&li(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=_R(r.layoutBox,t):this.constraints=!1,this.elastic=kR(n),o!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&rn(i=>{this.constraints!==!1&&this.getAxisMotionValue(i)&&(this.constraints[i]=RR(r.layoutBox[i],this.constraints[i]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!li(t))return!1;const r=t.current;pr(r!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");const{projection:o}=this.visualElement;if(!o||!o.layout)return!1;const i=P2(r,o.root,this.visualElement.getTransformPagePoint());let s=TR(o.layout.layoutBox,i);if(n){const a=n(A2(s));this.hasMutatedConstraints=!!a,a&&(s=Gx(a))}return s}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:o,dragTransition:i,dragSnapToOrigin:s,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},c=rn(u=>{if(!ya(u,n,this.currentDirection))return;let f=l&&l[u]||{};s&&(f={min:0,max:0});const d=o?200:1e6,h=o?40:1e7,g={type:"inertia",velocity:r?t[u]:0,bounceStiffness:d,bounceDamping:h,timeConstant:750,restDelta:1,restSpeed:10,...i,...f};return this.startAxisValueAnimation(u,g)});return Promise.all(c).then(a)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return md(this.visualElement,t),r.start(oh(t,r,0,n,this.visualElement,!1))}stopAnimation(){rn(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){rn(t=>this.getAxisMotionValue(t).animation?.pause())}getAnimationState(t){return this.getAxisMotionValue(t).animation?.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),o=r[n];return o||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){rn(n=>{const{drag:r}=this.getProps();if(!ya(n,r,this.currentDirection))return;const{projection:o}=this.visualElement,i=this.getAxisMotionValue(n);if(o&&o.layout){const{min:s,max:a}=o.layout.layoutBox[n];i.set(t[n]-Ze(s,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!li(n)||!r||!this.constraints)return;this.stopAnimation();const o={x:0,y:0};rn(s=>{const a=this.getAxisMotionValue(s);if(a&&this.constraints!==!1){const l=a.get();o[s]=ER({min:l,max:l},this.constraints[s])}});const{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),rn(s=>{if(!ya(s,t,null))return;const a=this.getAxisMotionValue(s),{min:l,max:c}=this.constraints[s];a.set(Ze(l,c,o[s]))})}addListeners(){if(!this.visualElement.current)return;AR.set(this.visualElement,this);const t=this.visualElement.current,n=vs(t,"pointerdown",l=>{const{drag:c,dragListener:u=!0}=this.getProps();c&&u&&this.start(l)}),r=()=>{const{dragConstraints:l}=this.getProps();li(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:o}=this.visualElement,i=o.addEventListener("measure",r);o&&!o.layout&&(o.root&&o.root.updateScroll(),o.updateLayout()),Ue.read(r);const s=Ps(window,"resize",()=>this.scalePositionWithinConstraints()),a=o.addEventListener("didUpdate",(({delta:l,hasLayoutChanged:c})=>{this.isDragging&&c&&(rn(u=>{const f=this.getAxisMotionValue(u);f&&(this.originPoint[u]+=l[u].translate,f.set(f.get()+l[u].translate))}),this.visualElement.render())}));return()=>{s(),n(),i(),a&&a()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:o=!1,dragConstraints:i=!1,dragElastic:s=vd,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:o,dragConstraints:i,dragElastic:s,dragMomentum:a}}}function ya(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function NR(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class PR extends Gr{constructor(t){super(t),this.removeGroupControls=an,this.removeListeners=an,this.controls=new MR(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||an}unmount(){this.removeGroupControls(),this.removeListeners()}}const Pp=e=>(t,n)=>{e&&Ue.postRender(()=>e(t,n))};class LR extends Gr{constructor(){super(...arguments),this.removePointerDownListener=an}onPointerDown(t){this.session=new c1(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:l1(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:o}=this.node.getProps();return{onSessionStart:Pp(t),onStart:Pp(n),onMove:r,onEnd:(i,s)=>{delete this.session,o&&Ue.postRender(()=>o(i,s))}}}mount(){this.removePointerDownListener=vs(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const qa={hasAnimatedSinceResize:!0,hasEverUpdated:!1};let jc=!1;class FR extends S.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:o}=this.props,{projection:i}=t;i&&(n.group&&n.group.add(i),r&&r.register&&o&&r.register(i),jc&&i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,onExitComplete:()=>this.safeToRemove()})),qa.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:o,isPresent:i}=this.props,{projection:s}=r;return s&&(s.isPresent=i,jc=!0,o||t.layoutDependency!==n||n===void 0||t.isPresent!==i?s.willUpdate():this.safeToRemove(),t.isPresent!==i&&(i?s.promote():s.relegate()||Ue.postRender(()=>{const a=s.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),Gf.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:o}=t;jc=!0,o&&(o.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(o),r&&r.deregister&&r.deregister(o))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function d1(e){const[t,n]=Px(),r=S.useContext(Ef);return C.jsx(FR,{...e,layoutGroup:r,switchLayoutGroup:S.useContext(Kx),isPresent:t,safeToRemove:n})}function $R(e,t,n){const r=wt(e)?e:Si(e);return r.start(oh("",r,t,n)),r.animation}const OR=(e,t)=>e.depth-t.depth;class IR{constructor(){this.children=[],this.isDirty=!1}add(t){Af(this.children,t),this.isDirty=!0}remove(t){Mf(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(OR),this.isDirty=!1,this.children.forEach(t)}}function DR(e,t){const n=Ot.now(),r=({timestamp:o})=>{const i=o-n;i>=t&&(Or(r),e(i-t))};return Ue.setup(r,!0),()=>Or(r)}const f1=["TopLeft","TopRight","BottomLeft","BottomRight"],jR=f1.length,Lp=e=>typeof e=="string"?parseFloat(e):e,Fp=e=>typeof e=="number"||he.test(e);function VR(e,t,n,r,o,i){o?(e.opacity=Ze(0,n.opacity??1,BR(r)),e.opacityExit=Ze(t.opacity??1,0,zR(r))):i&&(e.opacity=Ze(t.opacity??1,n.opacity??1,r));for(let s=0;s<jR;s++){const a=`border${f1[s]}Radius`;let l=$p(t,a),c=$p(n,a);if(l===void 0&&c===void 0)continue;l||(l=0),c||(c=0),l===0||c===0||Fp(l)===Fp(c)?(e[a]=Math.max(Ze(Lp(l),Lp(c),r),0),(Vn.test(c)||Vn.test(l))&&(e[a]+="%")):e[a]=c}(t.rotate||n.rotate)&&(e.rotate=Ze(t.rotate||0,n.rotate||0,r))}function $p(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const BR=h1(0,.5,Z0),zR=h1(.5,.95,an);function h1(e,t,n){return r=>r<e?0:r>t?1:n(ks(e,t,r))}function Op(e,t){e.min=t.min,e.max=t.max}function hn(e,t){Op(e.x,t.x),Op(e.y,t.y)}function Ip(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function Dp(e,t,n,r,o){return e-=t,e=ul(e,1/n,r),o!==void 0&&(e=ul(e,1/o,r)),e}function HR(e,t=0,n=1,r=.5,o,i=e,s=e){if(Vn.test(t)&&(t=parseFloat(t),t=Ze(s.min,s.max,t/100)-s.min),typeof t!="number")return;let a=Ze(i.min,i.max,r);e===i&&(a-=t),e.min=Dp(e.min,t,n,a,o),e.max=Dp(e.max,t,n,a,o)}function jp(e,t,[n,r,o],i,s){HR(e,t[n],t[r],t[o],t.scale,i,s)}const WR=["x","scaleX","originX"],KR=["y","scaleY","originY"];function Vp(e,t,n,r){jp(e.x,t,WR,n?n.x:void 0,r?r.x:void 0),jp(e.y,t,KR,n?n.y:void 0,r?r.y:void 0)}function Bp(e){return e.translate===0&&e.scale===1}function g1(e){return Bp(e.x)&&Bp(e.y)}function zp(e,t){return e.min===t.min&&e.max===t.max}function UR(e,t){return zp(e.x,t.x)&&zp(e.y,t.y)}function Hp(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function p1(e,t){return Hp(e.x,t.x)&&Hp(e.y,t.y)}function Wp(e){return At(e.x)/At(e.y)}function Kp(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class GR{constructor(){this.members=[]}add(t){Af(this.members,t),t.scheduleRender()}remove(t){if(Mf(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(o=>t===o);if(n===0)return!1;let r;for(let o=n;o>=0;o--){const i=this.members[o];if(i.isPresent!==!1){r=i;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:o}=t.options;o===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function qR(e,t,n){let r="";const o=e.x.translate/t.x,i=e.y.translate/t.y,s=n?.z||0;if((o||i||s)&&(r=`translate3d(${o}px, ${i}px, ${s}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:c,rotate:u,rotateX:f,rotateY:d,skewX:h,skewY:g}=n;c&&(r=`perspective(${c}px) ${r}`),u&&(r+=`rotate(${u}deg) `),f&&(r+=`rotateX(${f}deg) `),d&&(r+=`rotateY(${d}deg) `),h&&(r+=`skewX(${h}deg) `),g&&(r+=`skewY(${g}deg) `)}const a=e.x.scale*t.x,l=e.y.scale*t.y;return(a!==1||l!==1)&&(r+=`scale(${a}, ${l})`),r||"none"}const Vc=["","X","Y","Z"],YR=1e3;let XR=0;function Bc(e,t,n,r){const{latestValues:o}=t;o[e]&&(n[e]=o[e],t.setStaticValue(e,0),r&&(r[e]=0))}function m1(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=t1(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:o,layoutId:i}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",Ue,!(o||i))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&m1(r)}function y1({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:o}){return class{constructor(s={},a=t?.()){this.id=XR++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(QR),this.nodes.forEach(rk),this.nodes.forEach(ok),this.nodes.forEach(ek)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=s,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new IR)}addEventListener(s,a){return this.eventHandlers.has(s)||this.eventHandlers.set(s,new Pf),this.eventHandlers.get(s).add(a)}notifyListeners(s,...a){const l=this.eventHandlers.get(s);l&&l.notify(...a)}hasListeners(s){return this.eventHandlers.has(s)}mount(s){if(this.instance)return;this.isSVG=Nx(s)&&!zE(s),this.instance=s;const{layoutId:a,layout:l,visualElement:c}=this.options;if(c&&!c.current&&c.mount(s),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(l||a)&&(this.isLayoutDirty=!0),e){let u,f=0;const d=()=>this.root.updateBlockedByResize=!1;Ue.read(()=>{f=window.innerWidth}),e(s,()=>{const h=window.innerWidth;h!==f&&(f=h,this.root.updateBlockedByResize=!0,u&&u(),u=DR(d,250),qa.hasAnimatedSinceResize&&(qa.hasAnimatedSinceResize=!1,this.nodes.forEach(qp)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&c&&(a||l)&&this.addEventListener("didUpdate",({delta:u,hasLayoutChanged:f,hasRelativeLayoutChanged:d,layout:h})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const g=this.options.transition||c.getDefaultTransition()||ck,{onLayoutAnimationStart:p,onLayoutAnimationComplete:m}=c.getProps(),x=!this.targetLayout||!p1(this.targetLayout,h),y=!f&&d;if(this.options.layoutRoot||this.resumeFrom||y||f&&(x||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const v={...Kf(g,"layout"),onPlay:p,onComplete:m};(c.shouldReduceMotion||this.options.layoutRoot)&&(v.delay=0,v.type=!1),this.startAnimation(v),this.setAnimationOrigin(u,y)}else f||qp(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=h})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const s=this.getStack();s&&s.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Or(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(ik),this.animationId++)}getTransformTemplate(){const{visualElement:s}=this.options;return s&&s.getProps().transformTemplate}willUpdate(s=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&m1(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u<this.path.length;u++){const f=this.path[u];f.shouldResetTransform=!0,f.updateScroll("snapshot"),f.options.layoutRoot&&f.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const c=this.getTransformTemplate();this.prevTransformTemplateValue=c?c(this.latestValues,""):void 0,this.updateSnapshot(),s&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(Up);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Gp);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(nk),this.nodes.forEach(ZR),this.nodes.forEach(JR)):this.nodes.forEach(Gp),this.clearAllSnapshots();const a=Ot.now();ht.delta=gr(0,1e3/60,a-ht.timestamp),ht.timestamp=a,ht.isProcessing=!0,Ac.update.process(ht),Ac.preRender.process(ht),Ac.render.process(ht),ht.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Gf.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(tk),this.sharedNodes.forEach(sk)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Ue.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Ue.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!At(this.snapshot.measuredBox.x)&&!At(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l<this.path.length;l++)this.path[l].updateScroll();const s=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected=at(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,s?s.layoutBox:void 0)}updateScroll(s="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===s&&(a=!1),a&&this.instance){const l=r(this.instance);this.scroll={animationId:this.root.animationId,phase:s,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!o)return;const s=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!g1(this.projectionDelta),l=this.getTransformTemplate(),c=l?l(this.latestValues,""):void 0,u=c!==this.prevTransformTemplateValue;s&&this.instance&&(a||oo(this.latestValues)||u)&&(o(this.instance,c),this.shouldResetTransform=!1,this.scheduleRender())}measure(s=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return s&&(l=this.removeTransform(l)),uk(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:s}=this.options;if(!s)return at();const a=s.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(dk))){const{scroll:c}=this.root;c&&(ci(a.x,c.offset.x),ci(a.y,c.offset.y))}return a}removeElementScroll(s){const a=at();if(hn(a,s),this.scroll?.wasRoot)return a;for(let l=0;l<this.path.length;l++){const c=this.path[l],{scroll:u,options:f}=c;c!==this.root&&u&&f.layoutScroll&&(u.wasRoot&&hn(a,s),ci(a.x,u.offset.x),ci(a.y,u.offset.y))}return a}applyTransform(s,a=!1){const l=at();hn(l,s);for(let c=0;c<this.path.length;c++){const u=this.path[c];!a&&u.options.layoutScroll&&u.scroll&&u!==u.root&&ui(l,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),oo(u.latestValues)&&ui(l,u.latestValues)}return oo(this.latestValues)&&ui(l,this.latestValues),l}removeTransform(s){const a=at();hn(a,s);for(let l=0;l<this.path.length;l++){const c=this.path[l];if(!c.instance||!oo(c.latestValues))continue;fd(c.latestValues)&&c.updateSnapshot();const u=at(),f=c.measurePageBox();hn(u,f),Vp(a,c.latestValues,c.snapshot?c.snapshot.layoutBox:void 0,u)}return oo(this.latestValues)&&Vp(a,this.latestValues),a}setTargetDelta(s){this.targetDelta=s,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(s){this.options={...this.options,...s,crossfade:s.crossfade!==void 0?s.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==ht.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(s=!1){const a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);const l=!!this.resumingFrom||this!==a;if(!(s||l&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:u,layoutId:f}=this.options;if(!this.layout||!(u||f))return;this.resolvedRelativeTargetAt=ht.timestamp;const d=this.getClosestProjectingParent();d&&this.linkedParentVersion!==d.layoutVersion&&!d.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(d&&d.layout?this.createRelativeTarget(d,this.layout.layoutBox,d.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=at(),this.targetWithTransforms=at()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),xR(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):hn(this.target,this.layout.layoutBox),Yx(this.target,this.targetDelta)):hn(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,d&&!!d.resumingFrom==!!this.resumingFrom&&!d.options.layoutScroll&&d.target&&this.animationProgress!==1?this.createRelativeTarget(d,this.target,d.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||fd(this.parent.latestValues)||qx(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(s,a,l){this.relativeParent=s,this.linkedParentVersion=s.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=at(),this.relativeTargetOrigin=at(),dl(this.relativeTargetOrigin,a,l),hn(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){const s=this.getLead(),a=!!this.resumingFrom||this!==s;let l=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(l=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=!1),this.resolvedRelativeTargetAt===ht.timestamp&&(l=!1),l)return;const{layout:c,layoutId:u}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(c||u))return;hn(this.layoutCorrected,this.layout.layoutBox);const f=this.treeScale.x,d=this.treeScale.y;N2(this.layoutCorrected,this.treeScale,this.path,a),s.layout&&!s.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(s.target=s.layout.layoutBox,s.targetWithTransforms=at());const{target:h}=s;if(!h){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Ip(this.prevProjectionDelta.x,this.projectionDelta.x),Ip(this.prevProjectionDelta.y,this.projectionDelta.y)),xs(this.projectionDelta,this.layoutCorrected,h,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==d||!Kp(this.projectionDelta.x,this.prevProjectionDelta.x)||!Kp(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",h))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(s=!0){if(this.options.visualElement?.scheduleRender(),s){const a=this.getStack();a&&a.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=di(),this.projectionDelta=di(),this.projectionDeltaWithTransform=di()}setAnimationOrigin(s,a=!1){const l=this.snapshot,c=l?l.latestValues:{},u={...this.latestValues},f=di();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const d=at(),h=l?l.source:void 0,g=this.layout?this.layout.source:void 0,p=h!==g,m=this.getStack(),x=!m||m.members.length<=1,y=!!(p&&!x&&this.options.crossfade===!0&&!this.path.some(lk));this.animationProgress=0;let v;this.mixTargetDelta=b=>{const w=b/1e3;Yp(f.x,s.x,w),Yp(f.y,s.y,w),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(dl(d,this.layout.layoutBox,this.relativeParent.layout.layoutBox),ak(this.relativeTarget,this.relativeTargetOrigin,d,w),v&&UR(this.relativeTarget,v)&&(this.isProjectionDirty=!1),v||(v=at()),hn(v,this.relativeTarget)),p&&(this.animationValues=u,VR(u,c,this.latestValues,w,y,x)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=w},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(s){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(Or(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Ue.update(()=>{qa.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Si(0)),this.currentAnimation=$R(this.motionValue,[0,1e3],{...s,velocity:0,isSync:!0,onUpdate:a=>{this.mixTargetDelta(a),s.onUpdate&&s.onUpdate(a)},onStop:()=>{},onComplete:()=>{s.onComplete&&s.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const s=this.getStack();s&&s.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(YR),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const s=this.getLead();let{targetWithTransforms:a,target:l,layout:c,latestValues:u}=s;if(!(!a||!l||!c)){if(this!==s&&this.layout&&c&&v1(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||at();const f=At(this.layout.layoutBox.x);l.x.min=s.target.x.min,l.x.max=l.x.min+f;const d=At(this.layout.layoutBox.y);l.y.min=s.target.y.min,l.y.max=l.y.min+d}hn(a,l),ui(a,u),xs(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(s,a){this.sharedNodes.has(s)||this.sharedNodes.set(s,new GR),this.sharedNodes.get(s).add(a);const c=a.options.initialPromotionConfig;a.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(a):void 0})}isLead(){const s=this.getStack();return s?s.lead===this:!0}getLead(){const{layoutId:s}=this.options;return s?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:s}=this.options;return s?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:s}=this.options;if(s)return this.root.sharedNodes.get(s)}promote({needsReset:s,transition:a,preserveFollowOpacity:l}={}){const c=this.getStack();c&&c.promote(this,l),s&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const s=this.getStack();return s?s.relegate(this):!1}resetSkewAndRotation(){const{visualElement:s}=this.options;if(!s)return;let a=!1;const{latestValues:l}=s;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const c={};l.z&&Bc("z",s,c,this.animationValues);for(let u=0;u<Vc.length;u++)Bc(`rotate${Vc[u]}`,s,c,this.animationValues),Bc(`skew${Vc[u]}`,s,c,this.animationValues);s.render();for(const u in c)s.setStaticValue(u,c[u]),this.animationValues&&(this.animationValues[u]=c[u]);s.scheduleRender()}applyProjectionStyles(s,a){if(!this.instance||this.isSVG)return;if(!this.isVisible){s.visibility="hidden";return}const l=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,s.visibility="",s.opacity="",s.pointerEvents=Ga(a?.pointerEvents)||"",s.transform=l?l(this.latestValues,""):"none";return}const c=this.getLead();if(!this.projectionDelta||!this.layout||!c.target){this.options.layoutId&&(s.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,s.pointerEvents=Ga(a?.pointerEvents)||""),this.hasProjected&&!oo(this.latestValues)&&(s.transform=l?l({},""):"none",this.hasProjected=!1);return}s.visibility="";const u=c.animationValues||c.latestValues;this.applyTransformsToTarget();let f=qR(this.projectionDeltaWithTransform,this.treeScale,u);l&&(f=l(u,f)),s.transform=f;const{x:d,y:h}=this.projectionDelta;s.transformOrigin=`${d.origin*100}% ${h.origin*100}% 0`,c.animationValues?s.opacity=c===this?u.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:u.opacityExit:s.opacity=c===this?u.opacity!==void 0?u.opacity:"":u.opacityExit!==void 0?u.opacityExit:0;for(const g in dd){if(u[g]===void 0)continue;const{correct:p,applyTo:m,isCSSVariable:x}=dd[g],y=f==="none"?u[g]:p(u[g],c);if(m){const v=m.length;for(let b=0;b<v;b++)s[m[b]]=y}else x?this.options.visualElement.renderState.vars[g]=y:s[g]=y}this.options.layoutId&&(s.pointerEvents=c===this?Ga(a?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(s=>s.currentAnimation?.stop()),this.root.nodes.forEach(Up),this.root.sharedNodes.clear()}}}function ZR(e){e.updateLayout()}function JR(e){const t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:r}=e.layout,{animationType:o}=e.options,i=t.source!==e.layout.source;o==="size"?rn(u=>{const f=i?t.measuredBox[u]:t.layoutBox[u],d=At(f);f.min=n[u].min,f.max=f.min+d}):v1(o,t.layoutBox,n)&&rn(u=>{const f=i?t.measuredBox[u]:t.layoutBox[u],d=At(n[u]);f.max=f.min+d,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[u].max=e.relativeTarget[u].min+d)});const s=di();xs(s,n,t.layoutBox);const a=di();i?xs(a,e.applyTransform(r,!0),t.measuredBox):xs(a,n,t.layoutBox);const l=!g1(s);let c=!1;if(!e.resumeFrom){const u=e.getClosestProjectingParent();if(u&&!u.resumeFrom){const{snapshot:f,layout:d}=u;if(f&&d){const h=at();dl(h,t.layoutBox,f.layoutBox);const g=at();dl(g,n,d.layoutBox),p1(h,g)||(c=!0),u.options.layoutRoot&&(e.relativeTarget=g,e.relativeTargetOrigin=h,e.relativeParent=u)}}}e.notifyListeners("didUpdate",{layout:n,snapshot:t,delta:a,layoutDelta:s,hasLayoutChanged:l,hasRelativeLayoutChanged:c})}else if(e.isLead()){const{onExitComplete:n}=e.options;n&&n()}e.options.transition=void 0}function QR(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function ek(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function tk(e){e.clearSnapshot()}function Up(e){e.clearMeasurements()}function Gp(e){e.isLayoutDirty=!1}function nk(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function qp(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function rk(e){e.resolveTargetDelta()}function ok(e){e.calcProjection()}function ik(e){e.resetSkewAndRotation()}function sk(e){e.removeLeadSnapshot()}function Yp(e,t,n){e.translate=Ze(t.translate,0,n),e.scale=Ze(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Xp(e,t,n,r){e.min=Ze(t.min,n.min,r),e.max=Ze(t.max,n.max,r)}function ak(e,t,n,r){Xp(e.x,t.x,n.x,r),Xp(e.y,t.y,n.y,r)}function lk(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const ck={duration:.45,ease:[.4,0,.1,1]},Zp=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Jp=Zp("applewebkit/")&&!Zp("chrome/")?Math.round:an;function Qp(e){e.min=Jp(e.min),e.max=Jp(e.max)}function uk(e){Qp(e.x),Qp(e.y)}function v1(e,t,n){return e==="position"||e==="preserve-aspect"&&!vR(Wp(t),Wp(n),.2)}function dk(e){return e!==e.root&&e.scroll?.wasRoot}const fk=y1({attachResizeListener:(e,t)=>Ps(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),zc={current:void 0},x1=y1({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!zc.current){const e=new fk({});e.mount(window),e.setOptions({layoutScroll:!0}),zc.current=e}return zc.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),hk={pan:{Feature:LR},drag:{Feature:PR,ProjectionNode:x1,MeasureLayout:d1}};function em(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const o="onHover"+n,i=r[o];i&&Ue.postRender(()=>i(t,Ks(t)))}class gk extends Gr{mount(){const{current:t}=this.node;t&&(this.unmount=IE(t,(n,r)=>(em(this.node,r,"Start"),o=>em(this.node,o,"End"))))}unmount(){}}class pk extends Gr{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=zs(Ps(this.node.current,"focus",()=>this.onFocus()),Ps(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function tm(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const o="onTap"+(n==="End"?"":n),i=r[o];i&&Ue.postRender(()=>i(t,Ks(t)))}class mk extends Gr{mount(){const{current:t}=this.node;t&&(this.unmount=BE(t,(n,r)=>(tm(this.node,r,"Start"),(o,{success:i})=>tm(this.node,o,i?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const xd=new WeakMap,Hc=new WeakMap,yk=e=>{const t=xd.get(e.target);t&&t(e)},vk=e=>{e.forEach(yk)};function xk({root:e,...t}){const n=e||document;Hc.has(n)||Hc.set(n,{});const r=Hc.get(n),o=JSON.stringify(t);return r[o]||(r[o]=new IntersectionObserver(vk,{root:e,...t})),r[o]}function bk(e,t,n){const r=xk(t);return xd.set(e,n),r.observe(e),()=>{xd.delete(e),r.unobserve(e)}}const wk={some:0,all:1};class Ck extends Gr{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:o="some",once:i}=t,s={root:n?n.current:void 0,rootMargin:r,threshold:typeof o=="number"?o:wk[o]},a=l=>{const{isIntersecting:c}=l;if(this.isInView===c||(this.isInView=c,i&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",c);const{onViewportEnter:u,onViewportLeave:f}=this.node.getProps(),d=c?u:f;d&&d(l)};return bk(this.node.current,s,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(Sk(t,n))&&this.startObserver()}unmount(){}}function Sk({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const _k={inView:{Feature:Ck},tap:{Feature:mk},focus:{Feature:pk},hover:{Feature:gk}},Tk={layout:{ProjectionNode:x1,MeasureLayout:d1}},Ek={...fR,..._k,...hk,...Tk},Us=k2(Ek,B2),gn={fontFamily:"Inter, sans-serif",wordBreak:"break-word"},me={common:gn,title1:{...gn,fontSize:32,lineHeight:"36px",[us.md()]:{fontSize:24}},title2:{...gn,fontSize:24,lineHeight:"28px",[us.md()]:{fontSize:20}},title3:{...gn,fontSize:20,lineHeight:"28px",[us.md()]:{fontSize:18},[us.xs()]:{fontSize:16}},headline1:{...gn,fontSize:22,lineHeight:"26px"},headline2:{...gn,fontSize:18,lineHeight:"22px"},headline3:{...gn,fontSize:16,lineHeight:"20px"},body1:{...gn,fontSize:16,lineHeight:"24px"},body2:{...gn,fontSize:14,lineHeight:"20px"},caption1:{...gn,fontSize:12,lineHeight:"16px"},caption2:{...gn,fontSize:10,lineHeight:"14px"}},{transition:Rk,color:Zn,fontWeight:va}=j,xa={text:R.css({...me.common,transition:Rk.general}),"title-1":R.css({...me.title1}),"title-2":R.css({...me.title2}),"title-3":R.css({...me.title3}),"headline-1":R.css({...me.headline1}),"headline-2":R.css({...me.headline2}),"headline-3":R.css({...me.headline3}),"body-1":R.css({...me.body1}),"body-2":R.css({...me.body2}),"caption-1":R.css({...me.caption1}),"caption-2":R.css({...me.caption2}),primary:R.css({color:Zn.text.primary}),secondary:R.css({color:Zn.text.secondary}),tertiary:R.css({color:Zn.text.tertiary}),positive:R.css({color:Zn.text.positive}),negative:R.css({color:Zn.text.negative}),warning:R.css({color:Zn.text.warning}),accent:R.css({color:Zn.text.accent}),inverse:R.css({color:Zn.text.inverse}),transfer:R.css({color:Zn.text.transfer}),regular:R.css({fontWeight:va.regular}),medium:R.css({fontWeight:va.medium}),semibold:R.css({fontWeight:va.semibold}),bold:R.css({fontWeight:va.bold})},kk=e=>{let t;e.center?t="center":e.left?t="left":e.right&&(t="right");let n;return e.uppercase?n="uppercase":e.lowercase?n="lowercase":e.capitalize&&(n="capitalize"),R.css({marginTop:e.mt,marginBottom:e.mb,marginRight:e.mr,marginLeft:e.ml,flex:e.flex,cursor:e.cursor,wordBreak:e.wordBreak,whiteSpace:e.whiteSpace,textOverflow:e.textOverflow,textDecoration:e.decoration,textAlign:t,textTransform:n,color:e.color,opacity:e.disabled?.5:void 0,overflow:e.overflow})},se=S.forwardRef(({children:e,className:t,variant:n="body-1",fontWeight:r="medium",tag:o="p",colorName:i="primary",style:s,clickOpacity:a=.5,opacityDuration:l=200,onClick:c,disabled:u,mt:f,mb:d,ml:h,mr:g,flex:p,cursor:m,wordBreak:x,whiteSpace:y,textOverflow:v,decoration:b,color:w,center:_,left:E,right:T,uppercase:k,lowercase:P,capitalize:O,overflow:D,...I},$)=>{const[H,U]=S.useState(!1),L=!!c,N=()=>L&&U(!0),V=()=>L&&U(!1),K=kk({mt:f,mb:d,ml:h,mr:g,flex:p,cursor:m,wordBreak:x,whiteSpace:y,textOverflow:v,decoration:b,color:w,center:_,left:E,right:T,uppercase:k,lowercase:P,capitalize:O,overflow:D}),te=o,J=L?R.css({opacity:H?a:1,transition:`opacity ${l}ms ease`}):"";return C.jsx(te,{ref:$,...I,className:R.cx(xa.text,xa[n],xa[i],xa[r],J,t,K),style:s,onClick:c,onMouseDown:N,onMouseUp:V,onMouseLeave:V,onTouchStart:N,onTouchEnd:V,role:L?"button":void 0,tabIndex:L?0:void 0,children:e})});se.displayName="Text";const b1=Us(se),{color:bd,cornerRadius:Kt,height:ba,transition:Ak}=j,Mk=R.css({display:"flex",alignItems:"center",justifyContent:"center",position:"relative",borderRadius:16,height:48,padding:"0 16px",cursor:"pointer",fontSize:16,fontWeight:600,overflow:"hidden",transition:"all 0.2s ease",gap:8}),Qi={zero:Kt.zero,xs:Kt.xs,sm:Kt.sm,md:Kt.md,lg:Kt.lg,xl:Kt.xl,"2xl":Kt["2xl"],"3xl":Kt["3xl"],"4xl":Kt["4xl"],"5xl":Kt["5xl"],"6xl":Kt["6xl"],"full-round":Kt.fullRound},Nk={xs:ba.button.xs,sm:ba.button.sm,md:ba.button.md,lg:ba.button.lg},Pk={clear:R.css({backgroundColor:"transparent",border:"none"}),filled:R.css({backgroundColor:bd.fill.accentPrimary,color:"white",border:"none"}),outline:R.css({backgroundColor:"transparent",border:`1px solid ${bd.border.accentPrimary}`})},Lk=(e,t,n,r)=>{if(r)return R.css({cursor:"not-allowed",opacity:.7});const o={transition:Ak.general,borderRadius:Kt.lg,border:"none",color:e==="filled"?bd.text.inverse:`var(--text-${t})`};switch(e){case"filled":return R.css({...o,backgroundColor:`var(--fill-${t}-${n})`,":hover":{backgroundColor:`var(--fill-${t}-${n}-hover)`},":active":{backgroundColor:`var(--fill-${t}-${n}-hover)`}});case"outline":return R.css({...o,backgroundColor:"transparent",border:`1px solid var(--border-${t}-${n})`,":hover":{backgroundColor:`var(--fill-${t}-secondary-hover)`},":active":{backgroundColor:`var(--fill-${t}-secondary-hover)`}});case"clear":return R.css({...o,backgroundColor:"transparent",":hover":{backgroundColor:`var(--fill-${t}-secondary-hover)`},":active":{backgroundColor:`var(--fill-${t}-secondary-hover)`}});default:return R.css(o)}},{color:wa}=j,Ti=({disabled:e,loading:t,wrapperClassName:n,buttonClassName:r,buttonDisabledClassName:o,textClassName:i,children:s,variant:a="filled",backgroundColor:l,textColor:c,textFontWeight:u,borderColor:f,color:d="accent",opacity:h,borderRadius:g,width:p="full",size:m="md",iconLeft:x,iconRight:y,intensity:v="primary",flex:b,type:w="button",..._})=>{const E=S.useMemo(()=>{switch(p){case"full":return"100%";case"auto":return"auto";default:return p}},[p]),T=S.useMemo(()=>l||(a==="filled"?d==="neutral"?wa.fill.neutralSecondary:`var(--fill-${d}-${v})`:"transparent"),[a,l,d,v]),k=S.useMemo(()=>{if(v==="primary"){if(d==="neutral")return wa.text.secondary;if(a==="filled")return wa.text.inverse}else if(d==="neutral")return wa.text.secondary;return`var(--text-${d})`},[v,d,a]),P=S.useMemo(()=>{if(v==="primary"){if(d==="neutral")return"secondary";if(a==="filled")return"inverse"}else if(d==="neutral")return"secondary";return d},[a,d,v]),O=S.useMemo(()=>f||(a==="outline"?`var(--border-${d}-${v})`:"transparent"),[a,f,d,v]),D=S.useMemo(()=>{switch(m){case"lg":return Qi.lg;case"md":case"sm":return Qi.md;case"xs":return Qi.sm;default:return Qi.md}},[m]),I=R.cx(Mk,Lk(a,d,v,e),Pk[a],e?o:void 0,R.css({borderRadius:g?Qi[g]:D,backgroundColor:T,borderColor:O,color:c??`var(--text-${P})`,width:"100%",height:Nk[m],opacity:h||(e?.7:1)}),r),$=S.useMemo(()=>{switch(m){case"lg":case"md":return"body-1";case"sm":case"xs":return"body-2";default:return"body-1"}},[m]);return C.jsx(G,{className:R.cx(n),w:E,flex:b,relative:!0,overflow:"hidden",children:C.jsxs(Us.button,{..._,whileTap:!e&&!t?{scale:.99,boxShadow:"inset 0 0 0 10000px rgba(0,0,0,0.1)",transition:{duration:0}}:{},disabled:e||t,className:I,type:w,children:[t?C.jsx($0,{color:k}):C.jsxs(C.Fragment,{children:[x,C.jsx(b1,{style:{color:c},colorName:P,variant:$,className:i,textOverflow:"ellipsis",overflow:"hidden",children:s}),y]}),C.jsx($o,{})]})})},Fk=e=>M.createElement("svg",{width:16,height:16,viewBox:"0 0 24 24",fill:"none",...e},M.createElement("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z",fill:"currentColor"})),$k=e=>M.createElement("svg",{viewBox:"0 0 24 24",fill:"none",...e},M.createElement("path",{d:"M19 13H5v-2h14v2z",fill:"currentColor"})),{color:to}=j,br={checkbox:R.css({display:"inline-flex",alignItems:"flex-start",gap:8,userSelect:"none"}),disabled:R.css({cursor:"not-allowed",opacity:.5}),checkbox__input:R.css({position:"absolute",opacity:0,width:"var(--checkbox-size)",height:"var(--checkbox-size)"}),checkbox__box:R.css({width:"var(--checkbox-size)",height:"var(--checkbox-size)",display:"inline-flex",alignItems:"center",justifyContent:"center",borderRadius:4,border:`1px solid ${to.border.neutralAlphaHigh}`,backgroundColor:to.fill.bgSecondary,opacity:1,transition:"all 0.15s cubic-bezier(0.4, 0, 0.2, 1)",position:"relative","& svg":{color:to.border.accentPrimary}}),checked:R.css({borderColor:`${to.border.accentPrimary} !important`,backgroundColor:`${to.fill.accentSecondary} !important`}),error:R.css({borderColor:to.border.negativePrimary,backgroundColor:to.fill.negativeSecondary})},Ok={primary:R.css({}),secondary:R.css({backgroundColor:"transparent"})},Ik={sm:20,md:24},ih=S.forwardRef(({checked:e,onChange:t,disabled:n,error:r,indeterminate:o,size:i="md",title:s,titleColor:a,subtitle:l,subtitleColor:c="secondary",name:u,required:f,variant:d="primary",flex:h,readOnly:g},p)=>{const[m,x]=S.useState(!1),y=e!==void 0,v=y?e:m,b=k=>{y||x(k.target.checked),t?.(k)},w=Ik[i],_=v||o,E=!!g&&!n,T=n?"not-allowed":E?"auto":"pointer";return C.jsxs("label",{className:R.cx(br.checkbox,R.css({flex:h,cursor:T}),{[br.disabled]:n}),children:[C.jsxs(G,{relative:!0,display:"inline-flex",style:{"--checkbox-size":`${w}px`,"--checkbox-size-double":`${w*2}px`},children:[C.jsx("input",{ref:p,type:"checkbox",checked:v,onChange:E?void 0:b,onClick:k=>k.stopPropagation(),disabled:n,readOnly:E,name:u,required:f,className:R.cx(br.checkbox__input,{[br.disabled]:n},R.css({cursor:T}))}),C.jsx("div",{className:R.cx(br.checkbox__box,Ok[d],{[br.disabled]:n,[br.error]:r,[br.checked]:_}),children:_&&(o?C.jsx($k,{width:w*.75,height:w*.75}):C.jsx(Fk,{width:w*.75,height:w*.75}))})]}),(s||l)&&C.jsxs(G,{gap:4,children:[s&&C.jsx(se,{colorName:a,variant:i==="sm"?"body-2":"body-1",children:s}),l&&C.jsx(se,{variant:"body-2",colorName:c,children:l})]})]})});ih.displayName="Checkbox";const Dk=e=>M.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("g",{opacity:.5},M.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.0002 17.9999C14.4185 17.9999 18.0002 14.4182 18.0002 9.99991C18.0002 5.58163 14.4185 1.99991 10.0002 1.99991C5.58197 1.99991 2.00024 5.58163 2.00024 9.99991C2.00024 14.4182 5.58197 17.9999 10.0002 17.9999ZM6.46514 6.46446C6.85566 6.07393 7.48883 6.07393 7.87935 6.46446L9.64712 8.23222C9.84238 8.42749 10.159 8.42749 10.3542 8.23222L12.122 6.46446C12.5125 6.07393 13.1457 6.07393 13.5362 6.46446C13.9267 6.85498 13.9267 7.48814 13.5362 7.87867L11.7684 9.64644C11.5732 9.8417 11.5732 10.1583 11.7684 10.3535L13.5362 12.1213C13.9267 12.5118 13.9267 13.145 13.5362 13.5355C13.1457 13.926 12.5125 13.926 12.122 13.5355L10.3542 11.7678C10.159 11.5725 9.84238 11.5725 9.64712 11.7678L7.87935 13.5355C7.48883 13.926 6.85566 13.926 6.46514 13.5355C6.07462 13.145 6.07462 12.5118 6.46514 12.1213L8.23291 10.3535C8.42817 10.1583 8.42817 9.8417 8.23291 9.64644L6.46514 7.87867C6.07462 7.48815 6.07462 6.85498 6.46514 6.46446Z",fill:"currentColor"}))),{color:Jt,spacing:es}=j,Wc=R.css({opacity:.6,cursor:"not-allowed"}),yt={"input-container":R.css({backgroundColor:Jt.fill.accentSecondary,border:`1px solid ${Jt.border.neutralAlphaBasic}`,padding:`${es.md} ${es.lg}`,borderRadius:12,minHeight:40,width:"100%",transition:"border-color 0.2s ease, background-color 0.2s ease","& textarea":{resize:"none"},[`&:not(.${Wc}):hover`]:{backgroundColor:Jt.fill.neutralPrimaryHover},"&:focus-within":{borderColor:Jt.border.accentPrimary,[`&:not(.${Wc}):hover`]:{borderColor:Jt.border.accentPrimary}}}),input:R.css({...me.common,...me.body1,background:"transparent",width:"100%",color:Jt.text.primary,"&::placeholder":{color:Jt.text.tertiary,textOverflow:"ellipsis"}}),"input-text-size_sm":R.css({...me.body2}),"input-text-size_md":R.css({...me.body2}),"input-text-align_left":R.css({textAlign:"left"}),"input-text-align_center":R.css({textAlign:"center"}),"input-text-align_right":R.css({textAlign:"right"}),sm:R.css({height:40,padding:es.md}),md:R.css({height:48,padding:`14px ${es.lg} 14px ${es.lg}`}),error:R.css({borderColor:Jt.border.negativePrimary}),disabled:Wc,multiline:R.css({height:"auto"}),primary:R.css({background:Jt.fill.bgPrimary}),secondary:R.css({background:Jt.fill.bgSecondary}),"clear-button":R.css({cursor:"pointer",color:Jt.text.tertiary,height:20,"&:hover":{color:Jt.text.primary}})},{spacing:nm}=j;function rm(e){return{...new Event("input",{bubbles:!0}),target:e,currentTarget:e}}const Ei=S.forwardRef((e,t)=>{const{label:n,prompt:r,error:o,errorText:i,size:s="md",prefix:a,suffix:l,background:c="primary",showClearButton:u,disabled:f,value:d,defaultValue:h,inputClassName:g,textAlign:p="left",...m}=e,x=e.multiline===!0,y=S.useRef(null),v=S.useRef(null),[b,w]=Fo(typeof d=="string"||typeof d=="number"?String(d):void 0,typeof h=="string"||typeof h=="number"?String(h):"");S.useImperativeHandle(t,()=>({focus:()=>{y.current?.focus(),v.current?.focus()},blur:()=>{y.current?.blur(),v.current?.blur()},get value(){return y.current?.value||v.current?.value},set value(P){w(P),y.current&&(y.current.value=P),v.current&&(v.current.value=P)}}));const _=P=>{if(w(P.target.value),x){const O=e.onChange;O?.(P)}else{const O=e.onChange;O?.(P)}};S.useEffect(()=>{x&&e.autoResize&&v.current&&(v.current.style.height="auto",v.current.style.height=`${v.current.scrollHeight}px`)},[b,x,e.autoResize]);const E=()=>{if(w(""),!x){const O=y.current;if(O){O.value="";const D=rm(O),I=e.onChange;I?.(D)}return}const P=v.current;if(P){P.value="";const O=rm(P),D=e.onChange;D?.(O)}},T=()=>{if(x){const{rows:I,autoResize:$,onChange:H,multiline:U,...L}=m;return C.jsx("textarea",{ref:v,rows:e.rows??3,className:R.cx(yt.input,g,{[yt.disabled]:f,[yt[`input-text-align_${p}`]]:!!p}),disabled:f,maxLength:e.maxLength,...L,value:b,onChange:_})}const{onChange:P,multiline:O,...D}=m;return C.jsx("input",{...D,ref:y,className:R.cx(yt.input,yt[`input-text-size_${s}`],g,{[yt.disabled]:f,[yt[`input-text-align_${p}`]]:!!p}),disabled:f,type:e.type??"text",value:b,onChange:_})},k=S.useMemo(()=>c==="white"?yt.primary:c==="gray"?yt.secondary:yt[c],[c]);return C.jsxs(G,{w:"full",gap:nm.sm,children:[typeof n=="string"?C.jsx(se,{variant:"body-2",fontWeight:"regular",colorName:"tertiary",children:n}):n,C.jsxs(G,{row:!0,alignItems:x?"flex-start":"center",w:"full",gap:nm.md,className:R.cx(yt["input-container"],k,yt[s],{[yt.error]:o,[yt.disabled]:f,[yt.multiline]:x}),children:[a&&C.jsx(G,{flex:"none",children:a}),C.jsx(G,{flex:"1",children:T()}),u&&b&&!f&&C.jsx(G,{flex:"none",children:C.jsx("span",{className:yt["clear-button"],onClick:E,children:C.jsx(Dk,{})})}),l&&C.jsx(G,{flex:"none",children:l})]}),(r||x)&&C.jsxs(G,{row:!0,gap:10,w:"full",children:[typeof r=="string"?C.jsx(se,{variant:"caption-1",colorName:"tertiary",children:r}):r,x&&e.maxLength&&C.jsx(se,{right:!0,ml:"auto",flex:"none",variant:"caption-1",colorName:"tertiary",children:`${b.length}/${e.maxLength}`})]}),i&&o&&C.jsx(se,{variant:"body-2",colorName:"negative",fontWeight:"regular",children:i})]})});Ei.displayName="Input";const jk=e=>M.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("path",{d:"M15 8.33333H5M17.5 5H2.5M17.5 11.6667H2.5M15 15H5",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),Vk=e=>M.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("path",{d:"M13.3333 8.33333H2.5M16.6667 5H2.5M16.6667 11.6667H2.5M13.3333 15H2.5",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),Bk=e=>M.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("path",{d:"M17.5 8.33333H6.66665M17.5 5H3.33331M17.5 11.6667H3.33331M17.5 15H6.66665",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),zk=e=>M.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("path",{d:"M5 10H11.6667C13.5076 10 15 8.50766 15 6.66671C15 4.82576 13.5076 3.33337 11.6667 3.33337H5V10ZM5 10H12.5C14.3409 10 15.8333 11.4924 15.8333 13.3334C15.8333 15.1743 14.3409 16.6667 12.5 16.6667H5V10Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),Hk=e=>M.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("path",{d:"M13.5 17.5H5.77614C5.2713 17.5 5.01887 17.5 4.90199 17.4002C4.80056 17.3135 4.74674 17.1836 4.75721 17.0506C4.76927 16.8974 4.94776 16.7189 5.30474 16.3619L12.3905 9.27614C12.7205 8.94613 12.8855 8.78112 13.0758 8.7193C13.2432 8.66492 13.4235 8.66492 13.5908 8.7193C13.7811 8.78112 13.9461 8.94613 14.2761 9.27614L17.5 12.5V13.5M13.5 17.5C14.9001 17.5 15.6002 17.5 16.135 17.2275C16.6054 16.9878 16.9878 16.6054 17.2275 16.135C17.5 15.6002 17.5 14.9001 17.5 13.5M13.5 17.5H6.5C5.09987 17.5 4.3998 17.5 3.86502 17.2275C3.39462 16.9878 3.01217 16.6054 2.77248 16.135C2.5 15.6002 2.5 14.9001 2.5 13.5V6.5C2.5 5.09987 2.5 4.3998 2.77248 3.86502C3.01217 3.39462 3.39462 3.01217 3.86502 2.77248C4.3998 2.5 5.09987 2.5 6.5 2.5H13.5C14.9001 2.5 15.6002 2.5 16.135 2.77248C16.6054 3.01217 16.9878 3.39462 17.2275 3.86502C17.5 4.3998 17.5 5.09987 17.5 6.5V13.5M8.75 7.08333C8.75 8.00381 8.00381 8.75 7.08333 8.75C6.16286 8.75 5.41667 8.00381 5.41667 7.08333C5.41667 6.16286 6.16286 5.41667 7.08333 5.41667C8.00381 5.41667 8.75 6.16286 8.75 7.08333Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),Wk=e=>M.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("path",{d:"M15.8334 3.33337H8.33335M11.6667 16.6667H4.16669M12.5 3.33337L7.50002 16.6667",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),Kk=e=>M.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("g",{clipPath:"url(#clip0_1571_1710)"},M.createElement("path",{d:"M8.33332 10.8333C8.69119 11.3118 9.14778 11.7077 9.67211 11.9941C10.1964 12.2806 10.7762 12.4509 11.3722 12.4936C11.9681 12.5363 12.5663 12.4503 13.1261 12.2415C13.6859 12.0327 14.1942 11.7059 14.6167 11.2833L17.1167 8.78335C17.8756 7.9975 18.2956 6.94499 18.2861 5.85251C18.2766 4.76002 17.8384 3.71497 17.0659 2.94243C16.2934 2.1699 15.2483 1.7317 14.1558 1.7222C13.0633 1.71271 12.0108 2.13269 11.225 2.89168L9.79165 4.31668M11.6666 9.16668C11.3088 8.68824 10.8522 8.29236 10.3279 8.0059C9.80353 7.71943 9.22373 7.54908 8.62777 7.5064C8.03182 7.46372 7.43366 7.54971 6.87386 7.75853C6.31406 7.96735 5.80572 8.29412 5.38332 8.71668L2.88332 11.2167C2.12432 12.0025 1.70435 13.055 1.71384 14.1475C1.72334 15.24 2.16154 16.2851 2.93407 17.0576C3.70661 17.8301 4.75166 18.2683 5.84414 18.2778C6.93663 18.2873 7.98914 17.8673 8.77498 17.1083L10.2 15.6833",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),M.createElement("defs",null,M.createElement("clipPath",{id:"clip0_1571_1710"},M.createElement("rect",{width:20,height:20,fill:"white"})))),Uk=e=>M.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("path",{d:"M17.5 9.99996L7.5 9.99996M17.5 4.99996L7.5 4.99996M17.5 15L7.5 15M4.16667 9.99996C4.16667 10.4602 3.79357 10.8333 3.33333 10.8333C2.8731 10.8333 2.5 10.4602 2.5 9.99996C2.5 9.53972 2.8731 9.16663 3.33333 9.16663C3.79357 9.16663 4.16667 9.53972 4.16667 9.99996ZM4.16667 4.99996C4.16667 5.4602 3.79357 5.83329 3.33333 5.83329C2.8731 5.83329 2.5 5.4602 2.5 4.99996C2.5 4.53972 2.8731 4.16663 3.33333 4.16663C3.79357 4.16663 4.16667 4.53972 4.16667 4.99996ZM4.16667 15C4.16667 15.4602 3.79357 15.8333 3.33333 15.8333C2.8731 15.8333 2.5 15.4602 2.5 15C2.5 14.5397 2.8731 14.1666 3.33333 14.1666C3.79357 14.1666 4.16667 14.5397 4.16667 15Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),Gk=e=>M.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("path",{d:"M14 8.74967C14.4142 8.74967 14.75 8.41389 14.75 7.99967C14.75 7.58546 14.4142 7.24967 14 7.24967V7.99967V8.74967ZM6 7.24967C5.58579 7.24967 5.25 7.58546 5.25 7.99967C5.25 8.41389 5.58579 8.74967 6 8.74967V7.99967V7.24967ZM14 4.74967C14.4142 4.74967 14.75 4.41389 14.75 3.99967C14.75 3.58546 14.4142 3.24967 14 3.24967V3.99967V4.74967ZM6 3.24967C5.58579 3.24967 5.25 3.58546 5.25 3.99967C5.25 4.41389 5.58579 4.74967 6 4.74967V3.99967V3.24967ZM14 12.7497C14.4142 12.7497 14.75 12.4139 14.75 11.9997C14.75 11.5855 14.4142 11.2497 14 11.2497V11.9997V12.7497ZM6 11.2497C5.58579 11.2497 5.25 11.5855 5.25 11.9997C5.25 12.4139 5.58579 12.7497 6 12.7497V11.9997V11.2497ZM1.58967 3.48952C1.24295 3.71614 1.14558 4.18092 1.3722 4.52765C1.59882 4.87437 2.0636 4.97174 2.41033 4.74512L2 4.11732L1.58967 3.48952ZM3.2 3.33301H3.95C3.95 3.05764 3.79909 2.80441 3.5569 2.67337C3.31471 2.54233 3.02018 2.55455 2.78967 2.70521L3.2 3.33301ZM2.4 5.91634C1.98579 5.91634 1.65 6.25213 1.65 6.66634C1.65 7.08055 1.98579 7.41634 2.4 7.41634V6.66634V5.91634ZM4 7.41634C4.41421 7.41634 4.75 7.08055 4.75 6.66634C4.75 6.25213 4.41421 5.91634 4 5.91634V6.66634V7.41634ZM3.73743 10.8967L4.2726 11.4222L4.2726 11.4222L3.73743 10.8967ZM2 12.6663L1.46483 12.1409C1.25318 12.3565 1.19153 12.678 1.30841 12.9565C1.4253 13.2351 1.69791 13.4163 2 13.4163V12.6663ZM4 13.4163C4.41421 13.4163 4.75 13.0806 4.75 12.6663C4.75 12.2521 4.41421 11.9163 4 11.9163V12.6663V13.4163ZM1.25 10.2589C1.25 10.6731 1.58579 11.0089 2 11.0089C2.41421 11.0089 2.75 10.6731 2.75 10.2589H2H1.25ZM14 7.99967V7.24967L6 7.24967V7.99967V8.74967L14 8.74967V7.99967ZM14 3.99967V3.24967H6V3.99967V4.74967H14V3.99967ZM14 11.9997V11.2497L6 11.2497V11.9997V12.7497L14 12.7497V11.9997ZM2 4.11732L2.41033 4.74512L3.61033 3.96081L3.2 3.33301L2.78967 2.70521L1.58967 3.48952L2 4.11732ZM3.2 3.33301H2.45V6.66634H3.2H3.95V3.33301H3.2ZM3.2 6.66634V5.91634H2.4V6.66634V7.41634H3.2V6.66634ZM3.2 6.66634V7.41634H4V6.66634V5.91634H3.2V6.66634ZM3.73743 10.8967L3.20226 10.3713L1.46483 12.1409L2 12.6663L2.53517 13.1918L4.2726 11.4222L3.73743 10.8967ZM2 12.6663V13.4163H4V12.6663V11.9163H2V12.6663ZM4 10.2654H3.25C3.25 10.2957 3.23759 10.3353 3.20225 10.3713L3.73743 10.8967L4.2726 11.4222C4.57518 11.114 4.75 10.7002 4.75 10.2654H4ZM3 9.33301V10.083C3.08406 10.083 3.1515 10.1147 3.19493 10.1553C3.23791 10.1955 3.25 10.2354 3.25 10.2654H4H4.75C4.75 9.29296 3.91808 8.58301 3 8.58301V9.33301ZM2 10.2589H2.75C2.75 10.2299 2.76126 10.1927 2.80245 10.1545C2.84462 10.1155 2.91258 10.083 3 10.083V9.33301V8.58301C2.0889 8.58301 1.25 9.28004 1.25 10.2589H2Z",fill:"currentColor"})),qk=e=>M.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("path",{d:"M5 13.3334C5 15.1743 6.49238 16.6667 8.33333 16.6667H11.6667C13.5076 16.6667 15 15.1743 15 13.3334C15 11.4924 13.5076 10 11.6667 10M15 6.66671C15 4.82576 13.5076 3.33337 11.6667 3.33337H8.33333C6.49238 3.33337 5 4.82576 5 6.66671M2.5 10H17.5",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),Yk=e=>M.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("path",{d:"M2.5 7.5L17.5 7.5M7.5 2.5L7.5 17.5M6.5 2.5H13.5C14.9001 2.5 15.6002 2.5 16.135 2.77248C16.6054 3.01217 16.9878 3.39462 17.2275 3.86502C17.5 4.3998 17.5 5.09987 17.5 6.5V13.5C17.5 14.9001 17.5 15.6002 17.2275 16.135C16.9878 16.6054 16.6054 16.9878 16.135 17.2275C15.6002 17.5 14.9001 17.5 13.5 17.5H6.5C5.09987 17.5 4.3998 17.5 3.86502 17.2275C3.39462 16.9878 3.01217 16.6054 2.77248 16.135C2.5 15.6002 2.5 14.9001 2.5 13.5V6.5C2.5 5.09987 2.5 4.3998 2.77248 3.86502C3.01217 3.39462 3.39462 3.01217 3.86502 2.77248C4.3998 2.5 5.09987 2.5 6.5 2.5Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),Xk=e=>M.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("path",{d:"M15 3.33337V9.16671C15 11.9281 12.7614 14.1667 9.99998 14.1667C7.23856 14.1667 4.99998 11.9281 4.99998 9.16671V3.33337M3.33331 17.5H16.6666",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),sh=S.createContext(null);function Gs(){const e=S.useContext(sh);if(!e)throw new Error("useEditorStates must be used within EditorState Provider");return e}const w1=S.createContext(null);function Zk(){const e=S.useContext(w1);if(!e)throw new Error("useToolbarContext must be used within ToolbarContext provider");return e}var fs={exports:{}};fs.exports;var om;function Jk(){return om||(om=1,(function(e,t){var n=200,r="__lodash_hash_undefined__",o=800,i=16,s=9007199254740991,a="[object Arguments]",l="[object Array]",c="[object AsyncFunction]",u="[object Boolean]",f="[object Date]",d="[object Error]",h="[object Function]",g="[object GeneratorFunction]",p="[object Map]",m="[object Number]",x="[object Null]",y="[object Object]",v="[object Proxy]",b="[object RegExp]",w="[object Set]",_="[object String]",E="[object Undefined]",T="[object WeakMap]",k="[object ArrayBuffer]",P="[object DataView]",O="[object Float32Array]",D="[object Float64Array]",I="[object Int8Array]",$="[object Int16Array]",H="[object Int32Array]",U="[object Uint8Array]",L="[object Uint8ClampedArray]",N="[object Uint16Array]",V="[object Uint32Array]",K=/[\\^$.*+?()[\]{}|]/g,te=/^\[object .+?Constructor\]$/,J=/^(?:0|[1-9]\d*)$/,Z={};Z[O]=Z[D]=Z[I]=Z[$]=Z[H]=Z[U]=Z[L]=Z[N]=Z[V]=!0,Z[a]=Z[l]=Z[k]=Z[u]=Z[P]=Z[f]=Z[d]=Z[h]=Z[p]=Z[m]=Z[y]=Z[b]=Z[w]=Z[_]=Z[T]=!1;var ae=typeof Dn=="object"&&Dn&&Dn.Object===Object&&Dn,oe=typeof self=="object"&&self&&self.Object===Object&&self,fe=ae||oe||Function("return this")(),Te=t&&!t.nodeType&&t,ne=Te&&!0&&e&&!e.nodeType&&e,ve=ne&&ne.exports===Te,Ee=ve&&ae.process,De=(function(){try{var A=ne&&ne.require&&ne.require("util").types;return A||Ee&&Ee.binding&&Ee.binding("util")}catch{}})(),st=De&&De.isTypedArray;function ee(A,F,z){switch(z.length){case 0:return A.call(F);case 1:return A.call(F,z[0]);case 2:return A.call(F,z[0],z[1]);case 3:return A.call(F,z[0],z[1],z[2])}return A.apply(F,z)}function Ce(A,F){for(var z=-1,re=Array(A);++z<A;)re[z]=F(z);return re}function ze(A){return function(F){return A(F)}}function Re(A,F){return A?.[F]}function mt(A,F){return function(z){return A(F(z))}}var Ft=Array.prototype,Yt=Function.prototype,Xt=Object.prototype,xe=fe["__core-js_shared__"],Me=Yt.toString,Zt=Xt.hasOwnProperty,bg=(function(){var A=/[^.]+$/.exec(xe&&xe.keys&&xe.keys.IE_PROTO||"");return A?"Symbol(src)_1."+A:""})(),wg=Xt.toString,xS=Me.call(Object),bS=RegExp("^"+Me.call(Zt).replace(K,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),aa=ve?fe.Buffer:void 0,Cg=fe.Symbol,Sg=fe.Uint8Array;aa&&aa.allocUnsafe;var _g=mt(Object.getPrototypeOf,Object),Tg=Object.create,wS=Xt.propertyIsEnumerable,CS=Ft.splice,Zr=Cg?Cg.toStringTag:void 0,la=(function(){try{var A=xc(Object,"defineProperty");return A({},"",{}),A}catch{}})(),SS=aa?aa.isBuffer:void 0,Eg=Math.max,_S=Date.now,Rg=xc(fe,"Map"),Yi=xc(Object,"create"),TS=(function(){function A(){}return function(F){if(!Qr(F))return{};if(Tg)return Tg(F);A.prototype=F;var z=new A;return A.prototype=void 0,z}})();function Jr(A){var F=-1,z=A==null?0:A.length;for(this.clear();++F<z;){var re=A[F];this.set(re[0],re[1])}}function ES(){this.__data__=Yi?Yi(null):{},this.size=0}function RS(A){var F=this.has(A)&&delete this.__data__[A];return this.size-=F?1:0,F}function kS(A){var F=this.__data__;if(Yi){var z=F[A];return z===r?void 0:z}return Zt.call(F,A)?F[A]:void 0}function AS(A){var F=this.__data__;return Yi?F[A]!==void 0:Zt.call(F,A)}function MS(A,F){var z=this.__data__;return this.size+=this.has(A)?0:1,z[A]=Yi&&F===void 0?r:F,this}Jr.prototype.clear=ES,Jr.prototype.delete=RS,Jr.prototype.get=kS,Jr.prototype.has=AS,Jr.prototype.set=MS;function Xn(A){var F=-1,z=A==null?0:A.length;for(this.clear();++F<z;){var re=A[F];this.set(re[0],re[1])}}function NS(){this.__data__=[],this.size=0}function PS(A){var F=this.__data__,z=ca(F,A);if(z<0)return!1;var re=F.length-1;return z==re?F.pop():CS.call(F,z,1),--this.size,!0}function LS(A){var F=this.__data__,z=ca(F,A);return z<0?void 0:F[z][1]}function FS(A){return ca(this.__data__,A)>-1}function $S(A,F){var z=this.__data__,re=ca(z,A);return re<0?(++this.size,z.push([A,F])):z[re][1]=F,this}Xn.prototype.clear=NS,Xn.prototype.delete=PS,Xn.prototype.get=LS,Xn.prototype.has=FS,Xn.prototype.set=$S;function Bo(A){var F=-1,z=A==null?0:A.length;for(this.clear();++F<z;){var re=A[F];this.set(re[0],re[1])}}function OS(){this.size=0,this.__data__={hash:new Jr,map:new(Rg||Xn),string:new Jr}}function IS(A){var F=da(this,A).delete(A);return this.size-=F?1:0,F}function DS(A){return da(this,A).get(A)}function jS(A){return da(this,A).has(A)}function VS(A,F){var z=da(this,A),re=z.size;return z.set(A,F),this.size+=z.size==re?0:1,this}Bo.prototype.clear=OS,Bo.prototype.delete=IS,Bo.prototype.get=DS,Bo.prototype.has=jS,Bo.prototype.set=VS;function zo(A){var F=this.__data__=new Xn(A);this.size=F.size}function BS(){this.__data__=new Xn,this.size=0}function zS(A){var F=this.__data__,z=F.delete(A);return this.size=F.size,z}function HS(A){return this.__data__.get(A)}function WS(A){return this.__data__.has(A)}function KS(A,F){var z=this.__data__;if(z instanceof Xn){var re=z.__data__;if(!Rg||re.length<n-1)return re.push([A,F]),this.size=++z.size,this;z=this.__data__=new Bo(re)}return z.set(A,F),this.size=z.size,this}zo.prototype.clear=BS,zo.prototype.delete=zS,zo.prototype.get=HS,zo.prototype.has=WS,zo.prototype.set=KS;function US(A,F){var z=Cc(A),re=!z&&wc(A),Se=!z&&!re&&Pg(A),Oe=!z&&!re&&!Se&&Fg(A),He=z||re||Se||Oe,Ae=He?Ce(A.length,String):[],We=Ae.length;for(var fn in A)He&&(fn=="length"||Se&&(fn=="offset"||fn=="parent")||Oe&&(fn=="buffer"||fn=="byteLength"||fn=="byteOffset")||Mg(fn,We))||Ae.push(fn);return Ae}function yc(A,F,z){(z!==void 0&&!fa(A[F],z)||z===void 0&&!(F in A))&&vc(A,F,z)}function GS(A,F,z){var re=A[F];(!(Zt.call(A,F)&&fa(re,z))||z===void 0&&!(F in A))&&vc(A,F,z)}function ca(A,F){for(var z=A.length;z--;)if(fa(A[z][0],F))return z;return-1}function vc(A,F,z){F=="__proto__"&&la?la(A,F,{configurable:!0,enumerable:!0,value:z,writable:!0}):A[F]=z}var qS=a_();function ua(A){return A==null?A===void 0?E:x:Zr&&Zr in Object(A)?l_(A):g_(A)}function kg(A){return Xi(A)&&ua(A)==a}function YS(A){if(!Qr(A)||f_(A))return!1;var F=_c(A)?bS:te;return F.test(v_(A))}function XS(A){return Xi(A)&&Lg(A.length)&&!!Z[ua(A)]}function ZS(A){if(!Qr(A))return h_(A);var F=Ng(A),z=[];for(var re in A)re=="constructor"&&(F||!Zt.call(A,re))||z.push(re);return z}function Ag(A,F,z,re,Se){A!==F&&qS(F,function(Oe,He){if(Se||(Se=new zo),Qr(Oe))JS(A,F,He,z,Ag,re,Se);else{var Ae=re?re(bc(A,He),Oe,He+"",A,F,Se):void 0;Ae===void 0&&(Ae=Oe),yc(A,He,Ae)}},$g)}function JS(A,F,z,re,Se,Oe,He){var Ae=bc(A,z),We=bc(F,z),fn=He.get(We);if(fn){yc(A,z,fn);return}var Wt=Oe?Oe(Ae,We,z+"",A,F,He):void 0,Zi=Wt===void 0;if(Zi){var Tc=Cc(We),Ec=!Tc&&Pg(We),Ig=!Tc&&!Ec&&Fg(We);Wt=We,Tc||Ec||Ig?Cc(Ae)?Wt=Ae:x_(Ae)?Wt=o_(Ae):Ec?(Zi=!1,Wt=t_(We)):Ig?(Zi=!1,Wt=r_(We)):Wt=[]:b_(We)||wc(We)?(Wt=Ae,wc(Ae)?Wt=w_(Ae):(!Qr(Ae)||_c(Ae))&&(Wt=c_(We))):Zi=!1}Zi&&(He.set(We,Wt),Se(Wt,We,re,Oe,He),He.delete(We)),yc(A,z,Wt)}function QS(A,F){return m_(p_(A,F,Og),A+"")}var e_=la?function(A,F){return la(A,"toString",{configurable:!0,enumerable:!1,value:S_(F),writable:!0})}:Og;function t_(A,F){return A.slice()}function n_(A){var F=new A.constructor(A.byteLength);return new Sg(F).set(new Sg(A)),F}function r_(A,F){var z=n_(A.buffer);return new A.constructor(z,A.byteOffset,A.length)}function o_(A,F){var z=-1,re=A.length;for(F||(F=Array(re));++z<re;)F[z]=A[z];return F}function i_(A,F,z,re){var Se=!z;z||(z={});for(var Oe=-1,He=F.length;++Oe<He;){var Ae=F[Oe],We=void 0;We===void 0&&(We=A[Ae]),Se?vc(z,Ae,We):GS(z,Ae,We)}return z}function s_(A){return QS(function(F,z){var re=-1,Se=z.length,Oe=Se>1?z[Se-1]:void 0,He=Se>2?z[2]:void 0;for(Oe=A.length>3&&typeof Oe=="function"?(Se--,Oe):void 0,He&&u_(z[0],z[1],He)&&(Oe=Se<3?void 0:Oe,Se=1),F=Object(F);++re<Se;){var Ae=z[re];Ae&&A(F,Ae,re,Oe)}return F})}function a_(A){return function(F,z,re){for(var Se=-1,Oe=Object(F),He=re(F),Ae=He.length;Ae--;){var We=He[++Se];if(z(Oe[We],We,Oe)===!1)break}return F}}function da(A,F){var z=A.__data__;return d_(F)?z[typeof F=="string"?"string":"hash"]:z.map}function xc(A,F){var z=Re(A,F);return YS(z)?z:void 0}function l_(A){var F=Zt.call(A,Zr),z=A[Zr];try{A[Zr]=void 0;var re=!0}catch{}var Se=wg.call(A);return re&&(F?A[Zr]=z:delete A[Zr]),Se}function c_(A){return typeof A.constructor=="function"&&!Ng(A)?TS(_g(A)):{}}function Mg(A,F){var z=typeof A;return F=F??s,!!F&&(z=="number"||z!="symbol"&&J.test(A))&&A>-1&&A%1==0&&A<F}function u_(A,F,z){if(!Qr(z))return!1;var re=typeof F;return(re=="number"?Sc(z)&&Mg(F,z.length):re=="string"&&F in z)?fa(z[F],A):!1}function d_(A){var F=typeof A;return F=="string"||F=="number"||F=="symbol"||F=="boolean"?A!=="__proto__":A===null}function f_(A){return!!bg&&bg in A}function Ng(A){var F=A&&A.constructor,z=typeof F=="function"&&F.prototype||Xt;return A===z}function h_(A){var F=[];if(A!=null)for(var z in Object(A))F.push(z);return F}function g_(A){return wg.call(A)}function p_(A,F,z){return F=Eg(F===void 0?A.length-1:F,0),function(){for(var re=arguments,Se=-1,Oe=Eg(re.length-F,0),He=Array(Oe);++Se<Oe;)He[Se]=re[F+Se];Se=-1;for(var Ae=Array(F+1);++Se<F;)Ae[Se]=re[Se];return Ae[F]=z(He),ee(A,this,Ae)}}function bc(A,F){if(!(F==="constructor"&&typeof A[F]=="function")&&F!="__proto__")return A[F]}var m_=y_(e_);function y_(A){var F=0,z=0;return function(){var re=_S(),Se=i-(re-z);if(z=re,Se>0){if(++F>=o)return arguments[0]}else F=0;return A.apply(void 0,arguments)}}function v_(A){if(A!=null){try{return Me.call(A)}catch{}try{return A+""}catch{}}return""}function fa(A,F){return A===F||A!==A&&F!==F}var wc=kg((function(){return arguments})())?kg:function(A){return Xi(A)&&Zt.call(A,"callee")&&!wS.call(A,"callee")},Cc=Array.isArray;function Sc(A){return A!=null&&Lg(A.length)&&!_c(A)}function x_(A){return Xi(A)&&Sc(A)}var Pg=SS||__;function _c(A){if(!Qr(A))return!1;var F=ua(A);return F==h||F==g||F==c||F==v}function Lg(A){return typeof A=="number"&&A>-1&&A%1==0&&A<=s}function Qr(A){var F=typeof A;return A!=null&&(F=="object"||F=="function")}function Xi(A){return A!=null&&typeof A=="object"}function b_(A){if(!Xi(A)||ua(A)!=y)return!1;var F=_g(A);if(F===null)return!0;var z=Zt.call(F,"constructor")&&F.constructor;return typeof z=="function"&&z instanceof z&&Me.call(z)==xS}var Fg=st?ze(st):XS;function w_(A){return i_(A,$g(A))}function $g(A){return Sc(A)?US(A):ZS(A)}var C_=s_(function(A,F,z){Ag(A,F,z)});function S_(A){return function(){return A}}function Og(A){return A}function __(){return!1}e.exports=C_})(fs,fs.exports)),fs.exports}var Qk=Jk();const e3=_f(Qk),C1=S.createContext(null);function t3(){return S.useContext(C1)}function n3({children:e,locale:t}){return C.jsx(C1.Provider,{value:t||null,children:e})}function r3({localeKey:e,defaultLocale:t}){const n=S.createContext(t);function r(s){const{extraLocale:a}=s||{},l=t3();return{value:S.useMemo(()=>{const u=l?l[e]:null,f=[{},t];return u&&f.push(u),a&&f.push(a),e3(...f)},[t,a,e,l])}}function o(){return S.useContext(n)}function i({children:s,locale:a}){const{value:l}=r({extraLocale:a});return C.jsx(n.Provider,{value:l,children:s})}return{Context:n,useComposeLocaleProviderValue:r,useLocale:o,Provider:i}}const S1="MarkdownTextEditor",o3={toolbar:{link:{textPlaceholder:"Enter the text to display",linkPlaceholder:"Paste a link",linkErrorText:"Please enter a valid link",buttonText:"Save"},table:{maxRowsErrorText:e=>`Maximum number of rows is ${e.limit}`,maxColumnsErrorText:e=>`Maximum number of columns is ${e.limit}`,minRowsErrorText:e=>`Minimum number of rows is ${e.limit}`,minColumnsErrorText:e=>`Minimum number of columns is ${e.limit}`,rowsPlaceholder:"Rows count",columnsPlaceholder:"Columns count",buttonText:"Create table"},textSize:{paragraph:"Normal text",h1:"Heading 1",h2:"Heading 2",h3:"Heading 3"},preview:{show:"Preview",hide:"Preview"},actions:{bold:"Bold",italic:"Italic",underline:"Underline",strikethrough:"Strikethrough",link:"Link",image:"Image",alignLeft:"Align left",alignCenter:"Align center",alignRight:"Align right",table:"Table",bulletList:"Bullet list",numberedList:"Numbered list"}}},{Provider:i3,useLocale:qs}=r3({localeKey:S1,defaultLocale:o3}),_1=S.createContext(null);function s3(e,t){return{getTheme:function(){return t??null}}}function it(){const e=S.useContext(_1);return e==null&&(function(t,...n){const r=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",t);for(const i of n)o.append("v",i);throw r.search=o.toString(),Error(`Minified Lexical error #${t}; visit ${r.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)})(8),e}function q(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const o of t)r.append("v",o);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function T1(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const o of t)r.append("v",o);n.search=r.toString(),console.warn(`Minified Lexical warning #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const Mn=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,a3=Mn&&"documentMode"in document?document.documentMode:null,vn=Mn&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),wo=Mn&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),fl=!(!Mn||!("InputEvent"in window)||a3)&&"getTargetRanges"in new window.InputEvent("input"),Ys=Mn&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),Ii=Mn&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,l3=Mn&&/Android/.test(navigator.userAgent),E1=Mn&&/^(?=.*Chrome).*/i.test(navigator.userAgent),im=Mn&&l3&&E1,Xs=Mn&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&vn&&!E1;function R1(...e){const t=[];for(const n of e)if(n&&typeof n=="string")for(const[r]of n.matchAll(/\S+/g))t.push(r);return t}const c3=0,u3=1,d3=2,k1=128,f3=1,h3=2,g3=3,p3=4,m3=5,y3=6,Hl=Ys||Ii||Xs?" ":"​",Dr=`
34
+ `),()=>{m.contains(p)&&m.removeChild(p)}},[t]),C.jsx(XE,{isPresent:t,childRef:i,sizeRef:s,children:N.cloneElement(e,{ref:l})})}const JE=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:o,presenceAffectsLayout:i,mode:s,anchorX:a,root:l})=>{const c=$f(QE),u=S.useId();let f=!0,d=S.useMemo(()=>(f=!1,{id:u,initial:t,isPresent:n,custom:o,onExitComplete:h=>{c.set(h,!0);for(const g of c.values())if(!g)return;r&&r()},register:h=>(c.set(h,!1),()=>c.delete(h))}),[n,c,r]);return i&&f&&(d={...d}),S.useMemo(()=>{c.forEach((h,g)=>c.set(g,!1))},[n]),N.useEffect(()=>{!n&&!c.size&&r&&r()},[n]),s==="popLayout"&&(e=C.jsx(ZE,{isPresent:n,anchorX:a,root:l,children:e})),C.jsx(Gl.Provider,{value:d,children:e})};function QE(){return new Map}function Ix(e=!0){const t=S.useContext(Gl);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:o}=t,i=S.useId();S.useEffect(()=>{if(e)return o(i)},[e]);const s=S.useCallback(()=>e&&r&&r(i),[i,r,e]);return!n&&r?[!1,s]:[!0]}const _a=e=>e.key||"";function fp(e){const t=[];return S.Children.forEach(e,n=>{S.isValidElement(n)&&t.push(n)}),t}const Dx=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:o=!0,mode:i="sync",propagate:s=!1,anchorX:a="left",root:l})=>{const[c,u]=Ix(s),f=S.useMemo(()=>fp(e),[e]),d=s&&!c?[]:f.map(_a),h=S.useRef(!0),g=S.useRef(f),p=$f(()=>new Map),[m,v]=S.useState(f),[y,x]=S.useState(f);K0(()=>{h.current=!1,g.current=f;for(let _=0;_<y.length;_++){const E=_a(y[_]);d.includes(E)?p.delete(E):p.get(E)!==!0&&p.set(E,!1)}},[y,d.length,d.join("-")]);const b=[];if(f!==m){let _=[...f];for(let E=0;E<y.length;E++){const R=y[E],k=_a(R);d.includes(k)||(_.splice(E,0,R),b.push(R))}return i==="wait"&&b.length&&(_=b),x(fp(_)),v(f),null}process.env.NODE_ENV!=="production"&&i==="wait"&&y.length>1&&console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);const{forceRender:w}=S.useContext(Ff);return C.jsx(C.Fragment,{children:y.map(_=>{const E=_a(_),R=s&&!c?!1:f===y||d.includes(E),k=()=>{if(p.has(E))p.set(E,!0);else return;let M=!0;p.forEach(F=>{F||(M=!1)}),M&&(w?.(),x(g.current),s&&u?.(),r&&r())};return C.jsx(JE,{isPresent:R,initial:!h.current||n?void 0:!1,custom:t,presenceAffectsLayout:o,mode:i,root:l,onExitComplete:R?void 0:k,anchorX:a,children:_},E)})})},jx=S.createContext({strict:!1}),hp={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Li={};for(const e in hp)Li[e]={isEnabled:t=>hp[e].some(n=>!!t[n])};function e2(e){for(const t in e)Li[t]={...Li[t],...e[t]}}const t2=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function yl(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||t2.has(e)}let Vx=e=>!yl(e);function n2(e){typeof e=="function"&&(Vx=t=>t.startsWith("on")?!yl(t):e(t))}try{n2(require("@emotion/is-prop-valid").default)}catch{}function r2(e,t,n){const r={};for(const o in e)o==="values"&&typeof e.values=="object"||(Vx(o)||n===!0&&yl(o)||!t&&!yl(o)||e.draggable&&o.startsWith("onDrag"))&&(r[o]=e[o]);return r}const ql=S.createContext({});function Yl(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function js(e){return typeof e=="string"||Array.isArray(e)}const oh=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],ih=["initial",...oh];function Xl(e){return Yl(e.animate)||ih.some(t=>js(e[t]))}function Bx(e){return!!(Xl(e)||e.variants)}function o2(e,t){if(Xl(e)){const{initial:n,animate:r}=e;return{initial:n===!1||js(n)?n:void 0,animate:js(r)?r:void 0}}return e.inherit!==!1?t:{}}function i2(e){const{initial:t,animate:n}=o2(e,S.useContext(ql));return S.useMemo(()=>({initial:t,animate:n}),[gp(t),gp(n)])}function gp(e){return Array.isArray(e)?e.join(" "):e}function pp(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const ss={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(he.test(e))e=parseFloat(e);else return e;const n=pp(e,t.target.x),r=pp(e,t.target.y);return`${n}% ${r}%`}},s2={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,o=Vr.parse(e);if(o.length>5)return r;const i=Vr.createTransformer(e),s=typeof o[0]!="number"?1:0,a=n.x.scale*t.x,l=n.y.scale*t.y;o[0+s]/=a,o[1+s]/=l;const c=Je(a,l,.5);return typeof o[2+s]=="number"&&(o[2+s]/=c),typeof o[3+s]=="number"&&(o[3+s]/=c),i(o)}},bd={borderRadius:{...ss,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:ss,borderTopRightRadius:ss,borderBottomLeftRadius:ss,borderBottomRightRadius:ss,boxShadow:s2};function zx(e,{layout:t,layoutId:n}){return Wi.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!bd[e]||e==="opacity")}const a2={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},l2=Hi.length;function c2(e,t,n){let r="",o=!0;for(let i=0;i<l2;i++){const s=Hi[i],a=e[s];if(a===void 0)continue;let l=!0;if(typeof a=="number"?l=a===(s.startsWith("scale")?1:0):l=parseFloat(a)===0,!l||n){const c=Mx(a,eh[s]);if(!l){o=!1;const u=a2[s]||s;r+=`${u}(${c}) `}n&&(t[s]=c)}}return r=r.trim(),n?r=n(t,o?"":r):o&&(r="none"),r}function sh(e,t,n){const{style:r,vars:o,transformOrigin:i}=e;let s=!1,a=!1;for(const l in t){const c=t[l];if(Wi.has(l)){s=!0;continue}else if(lx(l)){o[l]=c;continue}else{const u=Mx(c,eh[l]);l.startsWith("origin")?(a=!0,i[l]=u):r[l]=u}}if(t.transform||(s||n?r.transform=c2(t,e.transform,n):r.transform&&(r.transform="none")),a){const{originX:l="50%",originY:c="50%",originZ:u=0}=i;r.transformOrigin=`${l} ${c} ${u}`}}const ah=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Hx(e,t,n){for(const r in t)!St(t[r])&&!zx(r,n)&&(e[r]=t[r])}function u2({transformTemplate:e},t){return S.useMemo(()=>{const n=ah();return sh(n,t,e),Object.assign({},n.vars,n.style)},[t])}function d2(e,t){const n=e.style||{},r={};return Hx(r,n,e),Object.assign(r,u2(e,t)),r}function f2(e,t){const n={},r=d2(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const h2={offset:"stroke-dashoffset",array:"stroke-dasharray"},g2={offset:"strokeDashoffset",array:"strokeDasharray"};function p2(e,t,n=1,r=0,o=!0){e.pathLength=1;const i=o?h2:g2;e[i.offset]=he.transform(-r);const s=he.transform(t),a=he.transform(n);e[i.array]=`${s} ${a}`}function Wx(e,{attrX:t,attrY:n,attrScale:r,pathLength:o,pathSpacing:i=1,pathOffset:s=0,...a},l,c,u){if(sh(e,a,c),l){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:f,style:d}=e;f.transform&&(d.transform=f.transform,delete f.transform),(d.transform||f.transformOrigin)&&(d.transformOrigin=f.transformOrigin??"50% 50%",delete f.transformOrigin),d.transform&&(d.transformBox=u?.transformBox??"fill-box",delete f.transformBox),t!==void 0&&(f.x=t),n!==void 0&&(f.y=n),r!==void 0&&(f.scale=r),o!==void 0&&p2(f,o,i,s,!1)}const Kx=()=>({...ah(),attrs:{}}),Ux=e=>typeof e=="string"&&e.toLowerCase()==="svg";function m2(e,t,n,r){const o=S.useMemo(()=>{const i=Kx();return Wx(i,t,Ux(r),e.transformTemplate,e.style),{...i.attrs,style:{...i.style}}},[t]);if(e.style){const i={};Hx(i,e.style,e),o.style={...i,...o.style}}return o}const y2=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function lh(e){return typeof e!="string"||e.includes("-")?!1:!!(y2.indexOf(e)>-1||/[A-Z]/u.test(e))}function v2(e,t,n,{latestValues:r},o,i=!1){const a=(lh(e)?m2:f2)(t,r,o,e),l=r2(t,typeof e=="string",i),c=e!==S.Fragment?{...l,...a,ref:n}:{},{children:u}=t,f=S.useMemo(()=>St(u)?u.get():u,[u]);return S.createElement(e,{...c,children:f})}function mp(e){const t=[{},{}];return e?.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function ch(e,t,n,r){if(typeof t=="function"){const[o,i]=mp(r);t=t(n!==void 0?n:e.custom,o,i)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[o,i]=mp(r);t=t(n!==void 0?n:e.custom,o,i)}return t}function tl(e){return St(e)?e.get():e}function x2({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,o){return{latestValues:b2(n,r,o,e),renderState:t()}}function b2(e,t,n,r){const o={},i=r(e,{});for(const d in i)o[d]=tl(i[d]);let{initial:s,animate:a}=e;const l=Xl(e),c=Bx(e);t&&c&&!l&&e.inherit!==!1&&(s===void 0&&(s=t.initial),a===void 0&&(a=t.animate));let u=n?n.initial===!1:!1;u=u||s===!1;const f=u?a:s;if(f&&typeof f!="boolean"&&!Yl(f)){const d=Array.isArray(f)?f:[f];for(let h=0;h<d.length;h++){const g=ch(e,d[h]);if(g){const{transitionEnd:p,transition:m,...v}=g;for(const y in v){let x=v[y];if(Array.isArray(x)){const b=u?x.length-1:0;x=x[b]}x!==null&&(o[y]=x)}for(const y in p)o[y]=p[y]}}}return o}const Gx=e=>(t,n)=>{const r=S.useContext(ql),o=S.useContext(Gl),i=()=>x2(e,t,r,o);return n?i():$f(i)};function uh(e,t,n){const{style:r}=e,o={};for(const i in r)(St(r[i])||t.style&&St(t.style[i])||zx(i,e)||n?.getValue(i)?.liveStyle!==void 0)&&(o[i]=r[i]);return o}const w2=Gx({scrapeMotionValuesFromProps:uh,createRenderState:ah});function qx(e,t,n){const r=uh(e,t,n);for(const o in e)if(St(e[o])||St(t[o])){const i=Hi.indexOf(o)!==-1?"attr"+o.charAt(0).toUpperCase()+o.substring(1):o;r[i]=e[o]}return r}const C2=Gx({scrapeMotionValuesFromProps:qx,createRenderState:Kx}),S2=Symbol.for("motionComponentSymbol");function yi(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function _2(e,t,n){return S.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):yi(n)&&(n.current=r))},[t])}const dh=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),T2="framerAppearId",Yx="data-"+dh(T2),Xx=S.createContext({});function E2(e,t,n,r,o){const{visualElement:i}=S.useContext(ql),s=S.useContext(jx),a=S.useContext(Gl),l=S.useContext(rh).reducedMotion,c=S.useRef(null);r=r||s.renderer,!c.current&&r&&(c.current=r(e,{visualState:t,parent:i,props:n,presenceContext:a,blockInitialAnimation:a?a.initial===!1:!1,reducedMotionConfig:l}));const u=c.current,f=S.useContext(Xx);u&&!u.projection&&o&&(u.type==="html"||u.type==="svg")&&R2(c.current,n,o,f);const d=S.useRef(!1);S.useInsertionEffect(()=>{u&&d.current&&u.update(n,a)});const h=n[Yx],g=S.useRef(!!h&&!window.MotionHandoffIsComplete?.(h)&&window.MotionHasOptimisedAnimation?.(h));return K0(()=>{u&&(d.current=!0,window.MotionIsMounted=!0,u.updateFeatures(),u.scheduleRenderMicrotask(),g.current&&u.animationState&&u.animationState.animateChanges())}),S.useEffect(()=>{u&&(!g.current&&u.animationState&&u.animationState.animateChanges(),g.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(h)}),g.current=!1),u.enteringChildren=void 0)}),u}function R2(e,t,n,r){const{layoutId:o,layout:i,drag:s,dragConstraints:a,layoutScroll:l,layoutRoot:c,layoutCrossfade:u}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:Zx(e.parent)),e.projection.setOptions({layoutId:o,layout:i,alwaysMeasureLayout:!!s||a&&yi(a),visualElement:e,animationType:typeof i=="string"?i:"both",initialPromotionConfig:r,crossfade:u,layoutScroll:l,layoutRoot:c})}function Zx(e){if(e)return e.options.allowProjection!==!1?e.projection:Zx(e.parent)}function Hc(e,{forwardMotionProps:t=!1}={},n,r){n&&e2(n);const o=lh(e)?C2:w2;function i(a,l){let c;const u={...S.useContext(rh),...a,layoutId:k2(a)},{isStatic:f}=u,d=i2(a),h=o(a,f);if(!f&&Of){A2(u,n);const g=N2(u);c=g.MeasureLayout,d.visualElement=E2(e,h,u,r,g.ProjectionNode)}return C.jsxs(ql.Provider,{value:d,children:[c&&d.visualElement?C.jsx(c,{visualElement:d.visualElement,...u}):null,v2(e,a,_2(h,d.visualElement,l),h,f,t)]})}i.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const s=S.forwardRef(i);return s[S2]=e,s}function k2({layoutId:e}){const t=S.useContext(Ff).id;return t&&e!==void 0?t+"-"+e:e}function A2(e,t){const n=S.useContext(jx).strict;if(process.env.NODE_ENV!=="production"&&t&&n){const r="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";e.ignoreStrict?Bi(!1,r,"lazy-strict-mode"):vr(!1,r,"lazy-strict-mode")}}function N2(e){const{drag:t,layout:n}=Li;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function M2(e,t){if(typeof Proxy>"u")return Hc;const n=new Map,r=(i,s)=>Hc(i,s,e,t),o=(i,s)=>(process.env.NODE_ENV!=="production"&&Bf(!1,"motion() is deprecated. Use motion.create() instead."),r(i,s));return new Proxy(o,{get:(i,s)=>s==="create"?r:(n.has(s)||n.set(s,Hc(s,void 0,e,t)),n.get(s))})}function Jx({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function P2({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function L2(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function Wc(e){return e===void 0||e===1}function wd({scale:e,scaleX:t,scaleY:n}){return!Wc(e)||!Wc(t)||!Wc(n)}function uo(e){return wd(e)||Qx(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Qx(e){return yp(e.x)||yp(e.y)}function yp(e){return e&&e!=="0%"}function vl(e,t,n){const r=e-n,o=t*r;return n+o}function vp(e,t,n,r,o){return o!==void 0&&(e=vl(e,o,r)),vl(e,n,r)+t}function Cd(e,t=0,n=1,r,o){e.min=vp(e.min,t,n,r,o),e.max=vp(e.max,t,n,r,o)}function eb(e,{x:t,y:n}){Cd(e.x,t.translate,t.scale,t.originPoint),Cd(e.y,n.translate,n.scale,n.originPoint)}const xp=.999999999999,bp=1.0000000000001;function F2(e,t,n,r=!1){const o=n.length;if(!o)return;t.x=t.y=1;let i,s;for(let a=0;a<o;a++){i=n[a],s=i.projectionDelta;const{visualElement:l}=i.options;l&&l.props.style&&l.props.style.display==="contents"||(r&&i.options.layoutScroll&&i.scroll&&i!==i.root&&xi(e,{x:-i.scroll.offset.x,y:-i.scroll.offset.y}),s&&(t.x*=s.x.scale,t.y*=s.y.scale,eb(e,s)),r&&uo(i.latestValues)&&xi(e,i.latestValues))}t.x<bp&&t.x>xp&&(t.x=1),t.y<bp&&t.y>xp&&(t.y=1)}function vi(e,t){e.min=e.min+t,e.max=e.max+t}function wp(e,t,n,r,o=.5){const i=Je(e.min,e.max,o);Cd(e,t,n,i,r)}function xi(e,t){wp(e.x,t.x,t.scaleX,t.scale,t.originX),wp(e.y,t.y,t.scaleY,t.scale,t.originY)}function tb(e,t){return Jx(L2(e.getBoundingClientRect(),t))}function $2(e,t,n){const r=tb(e,n),{scroll:o}=t;return o&&(vi(r.x,o.offset.x),vi(r.y,o.offset.y)),r}const Cp=()=>({translate:0,scale:1,origin:0,originPoint:0}),bi=()=>({x:Cp(),y:Cp()}),Sp=()=>({min:0,max:0}),ct=()=>({x:Sp(),y:Sp()}),Sd={current:null},nb={current:!1};function O2(){if(nb.current=!0,!!Of)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Sd.current=e.matches;e.addEventListener("change",t),t()}else Sd.current=!1}const I2=new WeakMap;function D2(e,t,n){for(const r in t){const o=t[r],i=n[r];if(St(o))e.addValue(r,o);else if(St(i))e.addValue(r,Pi(o,{owner:e}));else if(i!==o)if(e.hasValue(r)){const s=e.getValue(r);s.liveStyle===!0?s.jump(o):s.hasAnimated||s.set(o)}else{const s=e.getStaticValue(r);e.addValue(r,Pi(s!==void 0?s:o,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const _p=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class j2{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:o,blockInitialAnimation:i,visualState:s},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Jf,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const d=jt.now();this.renderScheduledAt<d&&(this.renderScheduledAt=d,Ue.render(this.render,!1,!0))};const{latestValues:l,renderState:c}=s;this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},this.renderState=c,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=o,this.options=a,this.blockInitialAnimation=!!i,this.isControllingVariants=Xl(n),this.isVariantNode=Bx(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:u,...f}=this.scrapeMotionValuesFromProps(n,{},this);for(const d in f){const h=f[d];l[d]!==void 0&&St(h)&&h.set(l[d])}}mount(t){this.current=t,I2.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,r)=>this.bindToMotionValue(r,n)),nb.current||O2(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Sd.current,process.env.NODE_ENV!=="production"&&Bf(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected.","reduced-motion-disabled"),this.parent?.addChild(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),jr(this.notifyUpdate),jr(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const r=Wi.has(t);r&&this.onBindTransform&&this.onBindTransform();const o=n.on("change",s=>{this.latestValues[t]=s,this.props.onUpdate&&Ue.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let i;window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{o(),i&&i(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Li){const n=Li[t];if(!n)continue;const{isEnabled:r,Feature:o}=n;if(!this.features[t]&&o&&r(this.props)&&(this.features[t]=new o(this)),this.features[t]){const i=this.features[t];i.isMounted?i.update():(i.mount(),i.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):ct()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<_p.length;r++){const o=_p[r];this.propEventSubscriptions[o]&&(this.propEventSubscriptions[o](),delete this.propEventSubscriptions[o]);const i="on"+o,s=t[i];s&&(this.propEventSubscriptions[o]=this.on(o,s))}this.prevMotionValues=D2(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=Pi(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(U0(r)||q0(r))?r=parseFloat(r):!GE(r)&&Vr.test(n)&&(r=Nx(t,n)),this.setBaseTarget(t,St(r)?r.get():r)),St(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const i=ch(this.props,n,this.presenceContext?.custom);i&&(r=i[t])}if(n&&r!==void 0)return r;const o=this.getBaseTargetFromProps(this.props,t);return o!==void 0&&!St(o)?o:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Vf),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){th.render(this.render)}}class rb extends j2{constructor(){super(...arguments),this.KeyframeResolver=$E}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;St(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function ob(e,{style:t,vars:n},r,o){const i=e.style;let s;for(s in t)i[s]=t[s];o?.applyProjectionStyles(i,r);for(s in n)i.setProperty(s,n[s])}function V2(e){return window.getComputedStyle(e)}class B2 extends rb{constructor(){super(...arguments),this.type="html",this.renderInstance=ob}readValueFromInstance(t,n){if(Wi.has(n))return this.projection?.isProjecting?hd(n):QT(t,n);{const r=V2(t),o=(lx(n)?r.getPropertyValue(n):r[n])||0;return typeof o=="string"?o.trim():o}}measureInstanceViewportBox(t,{transformPagePoint:n}){return tb(t,n)}build(t,n,r){sh(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return uh(t,n,r)}}const ib=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function z2(e,t,n,r){ob(e,t,void 0,r);for(const o in t.attrs)e.setAttribute(ib.has(o)?o:dh(o),t.attrs[o])}class H2 extends rb{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=ct}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Wi.has(n)){const r=Ax(n);return r&&r.default||0}return n=ib.has(n)?n:dh(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return qx(t,n,r)}build(t,n,r){Wx(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,o){z2(t,n,r,o)}mount(t){this.isSVGTag=Ux(t.tagName),super.mount(t)}}const W2=(e,t)=>lh(e)?new H2(t):new B2(t,{allowProjection:e!==S.Fragment});function Ci(e,t,n){const r=e.getProps();return ch(r,t,n!==void 0?n:r.custom,e)}const _d=e=>Array.isArray(e);function K2(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Pi(n))}function U2(e){return _d(e)?e[e.length-1]||0:e}function G2(e,t){const n=Ci(e,t);let{transitionEnd:r={},transition:o={},...i}=n||{};i={...i,...r};for(const s in i){const a=U2(i[s]);K2(e,s,a)}}function q2(e){return!!(St(e)&&e.add)}function Td(e,t){const n=e.getValue("willChange");if(q2(n))return n.add(t);if(!n&&xr.WillChange){const r=new xr.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function sb(e){return e.props[Yx]}const Y2=e=>e!==null;function X2(e,{repeat:t,repeatType:n="loop"},r){const o=e.filter(Y2),i=t&&n!=="loop"&&t%2===1?0:o.length-1;return o[i]}const Z2={type:"spring",stiffness:500,damping:25,restSpeed:10},J2=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Q2={type:"keyframes",duration:.8},eR={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},tR=(e,{keyframes:t})=>t.length>2?Q2:Wi.has(e)?e.startsWith("scale")?J2(t[1]):Z2:eR;function nR({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:o,repeat:i,repeatType:s,repeatDelay:a,from:l,elapsed:c,...u}){return!!Object.keys(u).length}const fh=(e,t,n,r={},o,i)=>s=>{const a=Qf(r,e)||{},l=a.delay||r.delay||0;let{elapsed:c=0}=r;c=c-Tn(l);const u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-c,onUpdate:d=>{t.set(d),a.onUpdate&&a.onUpdate(d)},onComplete:()=>{s(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:i?void 0:o};nR(a)||Object.assign(u,tR(e,u)),u.duration&&(u.duration=Tn(u.duration)),u.repeatDelay&&(u.repeatDelay=Tn(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let f=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(vd(u),u.delay===0&&(f=!0)),(xr.instantAnimations||xr.skipAnimations)&&(f=!0,vd(u),u.delay=0),u.allowFlatten=!a.type&&!a.ease,f&&!i&&t.get()!==void 0){const d=X2(u.keyframes,a);if(d!==void 0){Ue.update(()=>{u.onUpdate(d),u.onComplete()});return}}return a.isSync?new Zf(u):new CE(u)};function rR({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function ab(e,t,{delay:n=0,transitionOverride:r,type:o}={}){let{transition:i=e.getDefaultTransition(),transitionEnd:s,...a}=t;r&&(i=r);const l=[],c=o&&e.animationState&&e.animationState.getState()[o];for(const u in a){const f=e.getValue(u,e.latestValues[u]??null),d=a[u];if(d===void 0||c&&rR(c,u))continue;const h={delay:n,...Qf(i||{},u)},g=f.get();if(g!==void 0&&!f.isAnimating&&!Array.isArray(d)&&d===g&&!h.velocity)continue;let p=!1;if(window.MotionHandoffAnimation){const v=sb(e);if(v){const y=window.MotionHandoffAnimation(v,u,Ue);y!==null&&(h.startTime=y,p=!0)}}Td(e,u),f.start(fh(u,f,d,e.shouldReduceMotion&&Ex.has(u)?{type:!1}:h,e,p));const m=f.animation;m&&l.push(m)}return s&&Promise.all(l).then(()=>{Ue.update(()=>{s&&G2(e,s)})}),l}function lb(e,t,n,r=0,o=1){const i=Array.from(e).sort((c,u)=>c.sortNodePosition(u)).indexOf(t),s=e.size,a=(s-1)*r;return typeof n=="function"?n(i,s):o===1?i*r:a-i*r}function Ed(e,t,n={}){const r=Ci(e,t,n.type==="exit"?e.presenceContext?.custom:void 0);let{transition:o=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(o=n.transitionOverride);const i=r?()=>Promise.all(ab(e,r,n)):()=>Promise.resolve(),s=e.variantChildren&&e.variantChildren.size?(l=0)=>{const{delayChildren:c=0,staggerChildren:u,staggerDirection:f}=o;return oR(e,t,l,c,u,f,n)}:()=>Promise.resolve(),{when:a}=o;if(a){const[l,c]=a==="beforeChildren"?[i,s]:[s,i];return l().then(()=>c())}else return Promise.all([i(),s(n.delay)])}function oR(e,t,n=0,r=0,o=0,i=1,s){const a=[];for(const l of e.variantChildren)l.notify("AnimationStart",t),a.push(Ed(l,t,{...s,delay:n+(typeof r=="function"?0:r)+lb(e.variantChildren,l,r,o,i)}).then(()=>l.notify("AnimationComplete",t)));return Promise.all(a)}function iR(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const o=t.map(i=>Ed(e,i,n));r=Promise.all(o)}else if(typeof t=="string")r=Ed(e,t,n);else{const o=typeof t=="function"?Ci(e,t,n.custom):t;r=Promise.all(ab(e,o,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}function cb(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const sR=ih.length;function ub(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?ub(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<sR;n++){const r=ih[n],o=e.props[r];(js(o)||o===!1)&&(t[r]=o)}return t}const aR=[...oh].reverse(),lR=oh.length;function cR(e){return t=>Promise.all(t.map(({animation:n,options:r})=>iR(e,n,r)))}function uR(e){let t=cR(e),n=Tp(),r=!0;const o=l=>(c,u)=>{const f=Ci(e,u,l==="exit"?e.presenceContext?.custom:void 0);if(f){const{transition:d,transitionEnd:h,...g}=f;c={...c,...g,...h}}return c};function i(l){t=l(e)}function s(l){const{props:c}=e,u=ub(e.parent)||{},f=[],d=new Set;let h={},g=1/0;for(let m=0;m<lR;m++){const v=aR[m],y=n[v],x=c[v]!==void 0?c[v]:u[v],b=js(x),w=v===l?y.isActive:null;w===!1&&(g=m);let _=x===u[v]&&x!==c[v]&&b;if(_&&r&&e.manuallyAnimateOnMount&&(_=!1),y.protectedKeys={...h},!y.isActive&&w===null||!x&&!y.prevProp||Yl(x)||typeof x=="boolean")continue;const E=dR(y.prevProp,x);let R=E||v===l&&y.isActive&&!_&&b||m>g&&b,k=!1;const M=Array.isArray(x)?x:[x];let F=M.reduce(o(v),{});w===!1&&(F={});const{prevResolvedValues:D={}}=y,j={...D,...F},I=O=>{R=!0,d.has(O)&&(k=!0,d.delete(O)),y.needsAnimating[O]=!0;const P=e.getValue(O);P&&(P.liveStyle=!1)};for(const O in j){const P=F[O],K=D[O];if(h.hasOwnProperty(O))continue;let G=!1;_d(P)&&_d(K)?G=!cb(P,K):G=P!==K,G?P!=null?I(O):d.add(O):P!==void 0&&d.has(O)?I(O):y.protectedKeys[O]=!0}y.prevProp=x,y.prevResolvedValues=F,y.isActive&&(h={...h,...F}),r&&e.blockInitialAnimation&&(R=!1);const $=_&&E;R&&(!$||k)&&f.push(...M.map(O=>{const P={type:v};if(typeof O=="string"&&r&&!$&&e.manuallyAnimateOnMount&&e.parent){const{parent:K}=e,G=Ci(K,O);if(K.enteringChildren&&G){const{delayChildren:re}=G.transition||{};P.delay=lb(K.enteringChildren,e,re)}}return{animation:O,options:P}}))}if(d.size){const m={};if(typeof c.initial!="boolean"){const v=Ci(e,Array.isArray(c.initial)?c.initial[0]:c.initial);v&&v.transition&&(m.transition=v.transition)}d.forEach(v=>{const y=e.getBaseTarget(v),x=e.getValue(v);x&&(x.liveStyle=!0),m[v]=y??null}),f.push({animation:m})}let p=!!f.length;return r&&(c.initial===!1||c.initial===c.animate)&&!e.manuallyAnimateOnMount&&(p=!1),r=!1,p?t(f):Promise.resolve()}function a(l,c){if(n[l].isActive===c)return Promise.resolve();e.variantChildren?.forEach(f=>f.animationState?.setActive(l,c)),n[l].isActive=c;const u=s(l);for(const f in n)n[f].protectedKeys={};return u}return{animateChanges:s,setActive:a,setAnimateFunction:i,getState:()=>n,reset:()=>{n=Tp()}}}function dR(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!cb(t,e):!1}function so(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Tp(){return{animate:so(!0),whileInView:so(),whileHover:so(),whileTap:so(),whileDrag:so(),whileFocus:so(),exit:so()}}class Zr{constructor(t){this.isMounted=!1,this.node=t}update(){}}class fR extends Zr{constructor(t){super(t),t.animationState||(t.animationState=uR(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Yl(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let hR=0;class gR extends Zr{constructor(){super(...arguments),this.id=hR++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const o=this.node.animationState.setActive("exit",!t);n&&!t&&o.then(()=>{n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const pR={animation:{Feature:fR},exit:{Feature:gR}};function Vs(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function Qs(e){return{point:{x:e.pageX,y:e.pageY}}}const mR=e=>t=>nh(t)&&e(t,Qs(t));function Es(e,t,n,r){return Vs(e,t,mR(n),r)}const db=1e-4,yR=1-db,vR=1+db,fb=.01,xR=0-fb,bR=0+fb;function Pt(e){return e.max-e.min}function wR(e,t,n){return Math.abs(e-t)<=n}function Ep(e,t,n,r=.5){e.origin=r,e.originPoint=Je(t.min,t.max,e.origin),e.scale=Pt(n)/Pt(t),e.translate=Je(n.min,n.max,e.origin)-e.originPoint,(e.scale>=yR&&e.scale<=vR||isNaN(e.scale))&&(e.scale=1),(e.translate>=xR&&e.translate<=bR||isNaN(e.translate))&&(e.translate=0)}function Rs(e,t,n,r){Ep(e.x,t.x,n.x,r?r.originX:void 0),Ep(e.y,t.y,n.y,r?r.originY:void 0)}function Rp(e,t,n){e.min=n.min+t.min,e.max=e.min+Pt(t)}function CR(e,t,n){Rp(e.x,t.x,n.x),Rp(e.y,t.y,n.y)}function kp(e,t,n){e.min=t.min-n.min,e.max=e.min+Pt(t)}function xl(e,t,n){kp(e.x,t.x,n.x),kp(e.y,t.y,n.y)}function sn(e){return[e("x"),e("y")]}const hb=({current:e})=>e?e.ownerDocument.defaultView:null,Ap=(e,t)=>Math.abs(e-t);function SR(e,t){const n=Ap(e.x,t.x),r=Ap(e.y,t.y);return Math.sqrt(n**2+r**2)}class gb{constructor(t,n,{transformPagePoint:r,contextWindow:o=window,dragSnapToOrigin:i=!1,distanceThreshold:s=3}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const d=Uc(this.lastMoveEventInfo,this.history),h=this.startEvent!==null,g=SR(d.offset,{x:0,y:0})>=this.distanceThreshold;if(!h&&!g)return;const{point:p}=d,{timestamp:m}=mt;this.history.push({...p,timestamp:m});const{onStart:v,onMove:y}=this.handlers;h||(v&&v(this.lastMoveEvent,d),this.startEvent=this.lastMoveEvent),y&&y(this.lastMoveEvent,d)},this.handlePointerMove=(d,h)=>{this.lastMoveEvent=d,this.lastMoveEventInfo=Kc(h,this.transformPagePoint),Ue.update(this.updatePoint,!0)},this.handlePointerUp=(d,h)=>{this.end();const{onEnd:g,onSessionEnd:p,resumeAnimation:m}=this.handlers;if(this.dragSnapToOrigin&&m&&m(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const v=Uc(d.type==="pointercancel"?this.lastMoveEventInfo:Kc(h,this.transformPagePoint),this.history);this.startEvent&&g&&g(d,v),p&&p(d,v)},!nh(t))return;this.dragSnapToOrigin=i,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=s,this.contextWindow=o||window;const a=Qs(t),l=Kc(a,this.transformPagePoint),{point:c}=l,{timestamp:u}=mt;this.history=[{...c,timestamp:u}];const{onSessionStart:f}=n;f&&f(t,Uc(l,this.history)),this.removeListeners=Xs(Es(this.contextWindow,"pointermove",this.handlePointerMove),Es(this.contextWindow,"pointerup",this.handlePointerUp),Es(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),jr(this.updatePoint)}}function Kc(e,t){return t?{point:t(e.point)}:e}function Np(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Uc({point:e},t){return{point:e,delta:Np(e,pb(t)),offset:Np(e,_R(t)),velocity:TR(t,.1)}}function _R(e){return e[0]}function pb(e){return e[e.length-1]}function TR(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const o=pb(e);for(;n>=0&&(r=e[n],!(o.timestamp-r.timestamp>Tn(t)));)n--;if(!r)return{x:0,y:0};const i=ln(o.timestamp-r.timestamp);if(i===0)return{x:0,y:0};const s={x:(o.x-r.x)/i,y:(o.y-r.y)/i};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}function ER(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?Je(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?Je(n,e,r.max):Math.min(e,n)),e}function Mp(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function RR(e,{top:t,left:n,bottom:r,right:o}){return{x:Mp(e.x,n,o),y:Mp(e.y,t,r)}}function Pp(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function kR(e,t){return{x:Pp(e.x,t.x),y:Pp(e.y,t.y)}}function AR(e,t){let n=.5;const r=Pt(e),o=Pt(t);return o>r?n=Os(t.min,t.max-r,e.min):r>o&&(n=Os(e.min,e.max-o,t.min)),yr(0,1,n)}function NR(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const Rd=.35;function MR(e=Rd){return e===!1?e=0:e===!0&&(e=Rd),{x:Lp(e,"left","right"),y:Lp(e,"top","bottom")}}function Lp(e,t,n){return{min:Fp(e,t),max:Fp(e,n)}}function Fp(e,t){return typeof e=="number"?e:e[t]||0}const PR=new WeakMap;class LR{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=ct(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:o}=this.visualElement;if(o&&o.isPresent===!1)return;const i=f=>{const{dragSnapToOrigin:d}=this.getProps();d?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(Qs(f).point)},s=(f,d)=>{const{drag:h,dragPropagation:g,onDragStart:p}=this.getProps();if(h&&!g&&(this.openDragLock&&this.openDragLock(),this.openDragLock=jE(h),!this.openDragLock))return;this.latestPointerEvent=f,this.latestPanInfo=d,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),sn(v=>{let y=this.getAxisMotionValue(v).get()||0;if(Hn.test(y)){const{projection:x}=this.visualElement;if(x&&x.layout){const b=x.layout.layoutBox[v];b&&(y=Pt(b)*(parseFloat(y)/100))}}this.originPoint[v]=y}),p&&Ue.postRender(()=>p(f,d)),Td(this.visualElement,"transform");const{animationState:m}=this.visualElement;m&&m.setActive("whileDrag",!0)},a=(f,d)=>{this.latestPointerEvent=f,this.latestPanInfo=d;const{dragPropagation:h,dragDirectionLock:g,onDirectionLock:p,onDrag:m}=this.getProps();if(!h&&!this.openDragLock)return;const{offset:v}=d;if(g&&this.currentDirection===null){this.currentDirection=FR(v),this.currentDirection!==null&&p&&p(this.currentDirection);return}this.updateAxis("x",d.point,v),this.updateAxis("y",d.point,v),this.visualElement.render(),m&&m(f,d)},l=(f,d)=>{this.latestPointerEvent=f,this.latestPanInfo=d,this.stop(f,d),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>sn(f=>this.getAnimationState(f)==="paused"&&this.getAxisMotionValue(f).animation?.play()),{dragSnapToOrigin:u}=this.getProps();this.panSession=new gb(t,{onSessionStart:i,onStart:s,onMove:a,onSessionEnd:l,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,distanceThreshold:r,contextWindow:hb(this.visualElement)})}stop(t,n){const r=t||this.latestPointerEvent,o=n||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!o||!r)return;const{velocity:s}=o;this.startAnimation(s);const{onDragEnd:a}=this.getProps();a&&Ue.postRender(()=>a(r,o))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:o}=this.getProps();if(!r||!Ta(t,o,this.currentDirection))return;const i=this.getAxisMotionValue(t);let s=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(s=ER(s,this.constraints[t],this.elastic[t])),i.set(s)}resolveConstraints(){const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,o=this.constraints;t&&yi(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=RR(r.layoutBox,t):this.constraints=!1,this.elastic=MR(n),o!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&sn(i=>{this.constraints!==!1&&this.getAxisMotionValue(i)&&(this.constraints[i]=NR(r.layoutBox[i],this.constraints[i]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!yi(t))return!1;const r=t.current;vr(r!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");const{projection:o}=this.visualElement;if(!o||!o.layout)return!1;const i=$2(r,o.root,this.visualElement.getTransformPagePoint());let s=kR(o.layout.layoutBox,i);if(n){const a=n(P2(s));this.hasMutatedConstraints=!!a,a&&(s=Jx(a))}return s}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:o,dragTransition:i,dragSnapToOrigin:s,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},c=sn(u=>{if(!Ta(u,n,this.currentDirection))return;let f=l&&l[u]||{};s&&(f={min:0,max:0});const d=o?200:1e6,h=o?40:1e7,g={type:"inertia",velocity:r?t[u]:0,bounceStiffness:d,bounceDamping:h,timeConstant:750,restDelta:1,restSpeed:10,...i,...f};return this.startAxisValueAnimation(u,g)});return Promise.all(c).then(a)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return Td(this.visualElement,t),r.start(fh(t,r,0,n,this.visualElement,!1))}stopAnimation(){sn(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){sn(t=>this.getAxisMotionValue(t).animation?.pause())}getAnimationState(t){return this.getAxisMotionValue(t).animation?.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),o=r[n];return o||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){sn(n=>{const{drag:r}=this.getProps();if(!Ta(n,r,this.currentDirection))return;const{projection:o}=this.visualElement,i=this.getAxisMotionValue(n);if(o&&o.layout){const{min:s,max:a}=o.layout.layoutBox[n];i.set(t[n]-Je(s,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!yi(n)||!r||!this.constraints)return;this.stopAnimation();const o={x:0,y:0};sn(s=>{const a=this.getAxisMotionValue(s);if(a&&this.constraints!==!1){const l=a.get();o[s]=AR({min:l,max:l},this.constraints[s])}});const{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),sn(s=>{if(!Ta(s,t,null))return;const a=this.getAxisMotionValue(s),{min:l,max:c}=this.constraints[s];a.set(Je(l,c,o[s]))})}addListeners(){if(!this.visualElement.current)return;PR.set(this.visualElement,this);const t=this.visualElement.current,n=Es(t,"pointerdown",l=>{const{drag:c,dragListener:u=!0}=this.getProps();c&&u&&this.start(l)}),r=()=>{const{dragConstraints:l}=this.getProps();yi(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:o}=this.visualElement,i=o.addEventListener("measure",r);o&&!o.layout&&(o.root&&o.root.updateScroll(),o.updateLayout()),Ue.read(r);const s=Vs(window,"resize",()=>this.scalePositionWithinConstraints()),a=o.addEventListener("didUpdate",(({delta:l,hasLayoutChanged:c})=>{this.isDragging&&c&&(sn(u=>{const f=this.getAxisMotionValue(u);f&&(this.originPoint[u]+=l[u].translate,f.set(f.get()+l[u].translate))}),this.visualElement.render())}));return()=>{s(),n(),i(),a&&a()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:o=!1,dragConstraints:i=!1,dragElastic:s=Rd,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:o,dragConstraints:i,dragElastic:s,dragMomentum:a}}}function Ta(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function FR(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class $R extends Zr{constructor(t){super(t),this.removeGroupControls=cn,this.removeListeners=cn,this.controls=new LR(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||cn}unmount(){this.removeGroupControls(),this.removeListeners()}}const $p=e=>(t,n)=>{e&&Ue.postRender(()=>e(t,n))};class OR extends Zr{constructor(){super(...arguments),this.removePointerDownListener=cn}onPointerDown(t){this.session=new gb(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:hb(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:o}=this.node.getProps();return{onSessionStart:$p(t),onStart:$p(n),onMove:r,onEnd:(i,s)=>{delete this.session,o&&Ue.postRender(()=>o(i,s))}}}mount(){this.removePointerDownListener=Es(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const nl={hasAnimatedSinceResize:!0,hasEverUpdated:!1};let Gc=!1;class IR extends S.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:o}=this.props,{projection:i}=t;i&&(n.group&&n.group.add(i),r&&r.register&&o&&r.register(i),Gc&&i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,onExitComplete:()=>this.safeToRemove()})),nl.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:o,isPresent:i}=this.props,{projection:s}=r;return s&&(s.isPresent=i,Gc=!0,o||t.layoutDependency!==n||n===void 0||t.isPresent!==i?s.willUpdate():this.safeToRemove(),t.isPresent!==i&&(i?s.promote():s.relegate()||Ue.postRender(()=>{const a=s.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),th.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:o}=t;Gc=!0,o&&(o.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(o),r&&r.deregister&&r.deregister(o))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function mb(e){const[t,n]=Ix(),r=S.useContext(Ff);return C.jsx(IR,{...e,layoutGroup:r,switchLayoutGroup:S.useContext(Xx),isPresent:t,safeToRemove:n})}function DR(e,t,n){const r=St(e)?e:Pi(e);return r.start(fh("",r,t,n)),r.animation}const jR=(e,t)=>e.depth-t.depth;class VR{constructor(){this.children=[],this.isDirty=!1}add(t){If(this.children,t),this.isDirty=!0}remove(t){Df(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(jR),this.isDirty=!1,this.children.forEach(t)}}function BR(e,t){const n=jt.now(),r=({timestamp:o})=>{const i=o-n;i>=t&&(jr(r),e(i-t))};return Ue.setup(r,!0),()=>jr(r)}const yb=["TopLeft","TopRight","BottomLeft","BottomRight"],zR=yb.length,Op=e=>typeof e=="string"?parseFloat(e):e,Ip=e=>typeof e=="number"||he.test(e);function HR(e,t,n,r,o,i){o?(e.opacity=Je(0,n.opacity??1,WR(r)),e.opacityExit=Je(t.opacity??1,0,KR(r))):i&&(e.opacity=Je(t.opacity??1,n.opacity??1,r));for(let s=0;s<zR;s++){const a=`border${yb[s]}Radius`;let l=Dp(t,a),c=Dp(n,a);if(l===void 0&&c===void 0)continue;l||(l=0),c||(c=0),l===0||c===0||Ip(l)===Ip(c)?(e[a]=Math.max(Je(Op(l),Op(c),r),0),(Hn.test(c)||Hn.test(l))&&(e[a]+="%")):e[a]=c}(t.rotate||n.rotate)&&(e.rotate=Je(t.rotate||0,n.rotate||0,r))}function Dp(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const WR=vb(0,.5,nx),KR=vb(.5,.95,cn);function vb(e,t,n){return r=>r<e?0:r>t?1:n(Os(e,t,r))}function jp(e,t){e.min=t.min,e.max=t.max}function mn(e,t){jp(e.x,t.x),jp(e.y,t.y)}function Vp(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function Bp(e,t,n,r,o){return e-=t,e=vl(e,1/n,r),o!==void 0&&(e=vl(e,1/o,r)),e}function UR(e,t=0,n=1,r=.5,o,i=e,s=e){if(Hn.test(t)&&(t=parseFloat(t),t=Je(s.min,s.max,t/100)-s.min),typeof t!="number")return;let a=Je(i.min,i.max,r);e===i&&(a-=t),e.min=Bp(e.min,t,n,a,o),e.max=Bp(e.max,t,n,a,o)}function zp(e,t,[n,r,o],i,s){UR(e,t[n],t[r],t[o],t.scale,i,s)}const GR=["x","scaleX","originX"],qR=["y","scaleY","originY"];function Hp(e,t,n,r){zp(e.x,t,GR,n?n.x:void 0,r?r.x:void 0),zp(e.y,t,qR,n?n.y:void 0,r?r.y:void 0)}function Wp(e){return e.translate===0&&e.scale===1}function xb(e){return Wp(e.x)&&Wp(e.y)}function Kp(e,t){return e.min===t.min&&e.max===t.max}function YR(e,t){return Kp(e.x,t.x)&&Kp(e.y,t.y)}function Up(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function bb(e,t){return Up(e.x,t.x)&&Up(e.y,t.y)}function Gp(e){return Pt(e.x)/Pt(e.y)}function qp(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class XR{constructor(){this.members=[]}add(t){If(this.members,t),t.scheduleRender()}remove(t){if(Df(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(o=>t===o);if(n===0)return!1;let r;for(let o=n;o>=0;o--){const i=this.members[o];if(i.isPresent!==!1){r=i;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:o}=t.options;o===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function ZR(e,t,n){let r="";const o=e.x.translate/t.x,i=e.y.translate/t.y,s=n?.z||0;if((o||i||s)&&(r=`translate3d(${o}px, ${i}px, ${s}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:c,rotate:u,rotateX:f,rotateY:d,skewX:h,skewY:g}=n;c&&(r=`perspective(${c}px) ${r}`),u&&(r+=`rotate(${u}deg) `),f&&(r+=`rotateX(${f}deg) `),d&&(r+=`rotateY(${d}deg) `),h&&(r+=`skewX(${h}deg) `),g&&(r+=`skewY(${g}deg) `)}const a=e.x.scale*t.x,l=e.y.scale*t.y;return(a!==1||l!==1)&&(r+=`scale(${a}, ${l})`),r||"none"}const qc=["","X","Y","Z"],JR=1e3;let QR=0;function Yc(e,t,n,r){const{latestValues:o}=t;o[e]&&(n[e]=o[e],t.setStaticValue(e,0),r&&(r[e]=0))}function wb(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=sb(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:o,layoutId:i}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",Ue,!(o||i))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&wb(r)}function Cb({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:o}){return class{constructor(s={},a=t?.()){this.id=QR++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(nk),this.nodes.forEach(sk),this.nodes.forEach(ak),this.nodes.forEach(rk)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=s,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new VR)}addEventListener(s,a){return this.eventHandlers.has(s)||this.eventHandlers.set(s,new Vf),this.eventHandlers.get(s).add(a)}notifyListeners(s,...a){const l=this.eventHandlers.get(s);l&&l.notify(...a)}hasListeners(s){return this.eventHandlers.has(s)}mount(s){if(this.instance)return;this.isSVG=Ox(s)&&!KE(s),this.instance=s;const{layoutId:a,layout:l,visualElement:c}=this.options;if(c&&!c.current&&c.mount(s),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(l||a)&&(this.isLayoutDirty=!0),e){let u,f=0;const d=()=>this.root.updateBlockedByResize=!1;Ue.read(()=>{f=window.innerWidth}),e(s,()=>{const h=window.innerWidth;h!==f&&(f=h,this.root.updateBlockedByResize=!0,u&&u(),u=BR(d,250),nl.hasAnimatedSinceResize&&(nl.hasAnimatedSinceResize=!1,this.nodes.forEach(Zp)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&c&&(a||l)&&this.addEventListener("didUpdate",({delta:u,hasLayoutChanged:f,hasRelativeLayoutChanged:d,layout:h})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const g=this.options.transition||c.getDefaultTransition()||fk,{onLayoutAnimationStart:p,onLayoutAnimationComplete:m}=c.getProps(),v=!this.targetLayout||!bb(this.targetLayout,h),y=!f&&d;if(this.options.layoutRoot||this.resumeFrom||y||f&&(v||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const x={...Qf(g,"layout"),onPlay:p,onComplete:m};(c.shouldReduceMotion||this.options.layoutRoot)&&(x.delay=0,x.type=!1),this.startAnimation(x),this.setAnimationOrigin(u,y)}else f||Zp(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=h})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const s=this.getStack();s&&s.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),jr(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(lk),this.animationId++)}getTransformTemplate(){const{visualElement:s}=this.options;return s&&s.getProps().transformTemplate}willUpdate(s=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&wb(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u<this.path.length;u++){const f=this.path[u];f.shouldResetTransform=!0,f.updateScroll("snapshot"),f.options.layoutRoot&&f.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const c=this.getTransformTemplate();this.prevTransformTemplateValue=c?c(this.latestValues,""):void 0,this.updateSnapshot(),s&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(Yp);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Xp);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(ik),this.nodes.forEach(ek),this.nodes.forEach(tk)):this.nodes.forEach(Xp),this.clearAllSnapshots();const a=jt.now();mt.delta=yr(0,1e3/60,a-mt.timestamp),mt.timestamp=a,mt.isProcessing=!0,Ic.update.process(mt),Ic.preRender.process(mt),Ic.render.process(mt),mt.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,th.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(ok),this.sharedNodes.forEach(ck)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Ue.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Ue.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Pt(this.snapshot.measuredBox.x)&&!Pt(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l<this.path.length;l++)this.path[l].updateScroll();const s=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected=ct(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,s?s.layoutBox:void 0)}updateScroll(s="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===s&&(a=!1),a&&this.instance){const l=r(this.instance);this.scroll={animationId:this.root.animationId,phase:s,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!o)return;const s=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!xb(this.projectionDelta),l=this.getTransformTemplate(),c=l?l(this.latestValues,""):void 0,u=c!==this.prevTransformTemplateValue;s&&this.instance&&(a||uo(this.latestValues)||u)&&(o(this.instance,c),this.shouldResetTransform=!1,this.scheduleRender())}measure(s=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return s&&(l=this.removeTransform(l)),hk(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:s}=this.options;if(!s)return ct();const a=s.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(gk))){const{scroll:c}=this.root;c&&(vi(a.x,c.offset.x),vi(a.y,c.offset.y))}return a}removeElementScroll(s){const a=ct();if(mn(a,s),this.scroll?.wasRoot)return a;for(let l=0;l<this.path.length;l++){const c=this.path[l],{scroll:u,options:f}=c;c!==this.root&&u&&f.layoutScroll&&(u.wasRoot&&mn(a,s),vi(a.x,u.offset.x),vi(a.y,u.offset.y))}return a}applyTransform(s,a=!1){const l=ct();mn(l,s);for(let c=0;c<this.path.length;c++){const u=this.path[c];!a&&u.options.layoutScroll&&u.scroll&&u!==u.root&&xi(l,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),uo(u.latestValues)&&xi(l,u.latestValues)}return uo(this.latestValues)&&xi(l,this.latestValues),l}removeTransform(s){const a=ct();mn(a,s);for(let l=0;l<this.path.length;l++){const c=this.path[l];if(!c.instance||!uo(c.latestValues))continue;wd(c.latestValues)&&c.updateSnapshot();const u=ct(),f=c.measurePageBox();mn(u,f),Hp(a,c.latestValues,c.snapshot?c.snapshot.layoutBox:void 0,u)}return uo(this.latestValues)&&Hp(a,this.latestValues),a}setTargetDelta(s){this.targetDelta=s,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(s){this.options={...this.options,...s,crossfade:s.crossfade!==void 0?s.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==mt.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(s=!1){const a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);const l=!!this.resumingFrom||this!==a;if(!(s||l&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:u,layoutId:f}=this.options;if(!this.layout||!(u||f))return;this.resolvedRelativeTargetAt=mt.timestamp;const d=this.getClosestProjectingParent();d&&this.linkedParentVersion!==d.layoutVersion&&!d.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(d&&d.layout?this.createRelativeTarget(d,this.layout.layoutBox,d.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=ct(),this.targetWithTransforms=ct()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),CR(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):mn(this.target,this.layout.layoutBox),eb(this.target,this.targetDelta)):mn(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,d&&!!d.resumingFrom==!!this.resumingFrom&&!d.options.layoutScroll&&d.target&&this.animationProgress!==1?this.createRelativeTarget(d,this.target,d.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||wd(this.parent.latestValues)||Qx(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(s,a,l){this.relativeParent=s,this.linkedParentVersion=s.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=ct(),this.relativeTargetOrigin=ct(),xl(this.relativeTargetOrigin,a,l),mn(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){const s=this.getLead(),a=!!this.resumingFrom||this!==s;let l=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(l=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=!1),this.resolvedRelativeTargetAt===mt.timestamp&&(l=!1),l)return;const{layout:c,layoutId:u}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(c||u))return;mn(this.layoutCorrected,this.layout.layoutBox);const f=this.treeScale.x,d=this.treeScale.y;F2(this.layoutCorrected,this.treeScale,this.path,a),s.layout&&!s.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(s.target=s.layout.layoutBox,s.targetWithTransforms=ct());const{target:h}=s;if(!h){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Vp(this.prevProjectionDelta.x,this.projectionDelta.x),Vp(this.prevProjectionDelta.y,this.projectionDelta.y)),Rs(this.projectionDelta,this.layoutCorrected,h,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==d||!qp(this.projectionDelta.x,this.prevProjectionDelta.x)||!qp(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",h))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(s=!0){if(this.options.visualElement?.scheduleRender(),s){const a=this.getStack();a&&a.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=bi(),this.projectionDelta=bi(),this.projectionDeltaWithTransform=bi()}setAnimationOrigin(s,a=!1){const l=this.snapshot,c=l?l.latestValues:{},u={...this.latestValues},f=bi();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const d=ct(),h=l?l.source:void 0,g=this.layout?this.layout.source:void 0,p=h!==g,m=this.getStack(),v=!m||m.members.length<=1,y=!!(p&&!v&&this.options.crossfade===!0&&!this.path.some(dk));this.animationProgress=0;let x;this.mixTargetDelta=b=>{const w=b/1e3;Jp(f.x,s.x,w),Jp(f.y,s.y,w),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(xl(d,this.layout.layoutBox,this.relativeParent.layout.layoutBox),uk(this.relativeTarget,this.relativeTargetOrigin,d,w),x&&YR(this.relativeTarget,x)&&(this.isProjectionDirty=!1),x||(x=ct()),mn(x,this.relativeTarget)),p&&(this.animationValues=u,HR(u,c,this.latestValues,w,y,v)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=w},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(s){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(jr(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Ue.update(()=>{nl.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Pi(0)),this.currentAnimation=DR(this.motionValue,[0,1e3],{...s,velocity:0,isSync:!0,onUpdate:a=>{this.mixTargetDelta(a),s.onUpdate&&s.onUpdate(a)},onStop:()=>{},onComplete:()=>{s.onComplete&&s.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const s=this.getStack();s&&s.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(JR),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const s=this.getLead();let{targetWithTransforms:a,target:l,layout:c,latestValues:u}=s;if(!(!a||!l||!c)){if(this!==s&&this.layout&&c&&Sb(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||ct();const f=Pt(this.layout.layoutBox.x);l.x.min=s.target.x.min,l.x.max=l.x.min+f;const d=Pt(this.layout.layoutBox.y);l.y.min=s.target.y.min,l.y.max=l.y.min+d}mn(a,l),xi(a,u),Rs(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(s,a){this.sharedNodes.has(s)||this.sharedNodes.set(s,new XR),this.sharedNodes.get(s).add(a);const c=a.options.initialPromotionConfig;a.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(a):void 0})}isLead(){const s=this.getStack();return s?s.lead===this:!0}getLead(){const{layoutId:s}=this.options;return s?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:s}=this.options;return s?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:s}=this.options;if(s)return this.root.sharedNodes.get(s)}promote({needsReset:s,transition:a,preserveFollowOpacity:l}={}){const c=this.getStack();c&&c.promote(this,l),s&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const s=this.getStack();return s?s.relegate(this):!1}resetSkewAndRotation(){const{visualElement:s}=this.options;if(!s)return;let a=!1;const{latestValues:l}=s;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const c={};l.z&&Yc("z",s,c,this.animationValues);for(let u=0;u<qc.length;u++)Yc(`rotate${qc[u]}`,s,c,this.animationValues),Yc(`skew${qc[u]}`,s,c,this.animationValues);s.render();for(const u in c)s.setStaticValue(u,c[u]),this.animationValues&&(this.animationValues[u]=c[u]);s.scheduleRender()}applyProjectionStyles(s,a){if(!this.instance||this.isSVG)return;if(!this.isVisible){s.visibility="hidden";return}const l=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,s.visibility="",s.opacity="",s.pointerEvents=tl(a?.pointerEvents)||"",s.transform=l?l(this.latestValues,""):"none";return}const c=this.getLead();if(!this.projectionDelta||!this.layout||!c.target){this.options.layoutId&&(s.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,s.pointerEvents=tl(a?.pointerEvents)||""),this.hasProjected&&!uo(this.latestValues)&&(s.transform=l?l({},""):"none",this.hasProjected=!1);return}s.visibility="";const u=c.animationValues||c.latestValues;this.applyTransformsToTarget();let f=ZR(this.projectionDeltaWithTransform,this.treeScale,u);l&&(f=l(u,f)),s.transform=f;const{x:d,y:h}=this.projectionDelta;s.transformOrigin=`${d.origin*100}% ${h.origin*100}% 0`,c.animationValues?s.opacity=c===this?u.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:u.opacityExit:s.opacity=c===this?u.opacity!==void 0?u.opacity:"":u.opacityExit!==void 0?u.opacityExit:0;for(const g in bd){if(u[g]===void 0)continue;const{correct:p,applyTo:m,isCSSVariable:v}=bd[g],y=f==="none"?u[g]:p(u[g],c);if(m){const x=m.length;for(let b=0;b<x;b++)s[m[b]]=y}else v?this.options.visualElement.renderState.vars[g]=y:s[g]=y}this.options.layoutId&&(s.pointerEvents=c===this?tl(a?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(s=>s.currentAnimation?.stop()),this.root.nodes.forEach(Yp),this.root.sharedNodes.clear()}}}function ek(e){e.updateLayout()}function tk(e){const t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:r}=e.layout,{animationType:o}=e.options,i=t.source!==e.layout.source;o==="size"?sn(u=>{const f=i?t.measuredBox[u]:t.layoutBox[u],d=Pt(f);f.min=n[u].min,f.max=f.min+d}):Sb(o,t.layoutBox,n)&&sn(u=>{const f=i?t.measuredBox[u]:t.layoutBox[u],d=Pt(n[u]);f.max=f.min+d,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[u].max=e.relativeTarget[u].min+d)});const s=bi();Rs(s,n,t.layoutBox);const a=bi();i?Rs(a,e.applyTransform(r,!0),t.measuredBox):Rs(a,n,t.layoutBox);const l=!xb(s);let c=!1;if(!e.resumeFrom){const u=e.getClosestProjectingParent();if(u&&!u.resumeFrom){const{snapshot:f,layout:d}=u;if(f&&d){const h=ct();xl(h,t.layoutBox,f.layoutBox);const g=ct();xl(g,n,d.layoutBox),bb(h,g)||(c=!0),u.options.layoutRoot&&(e.relativeTarget=g,e.relativeTargetOrigin=h,e.relativeParent=u)}}}e.notifyListeners("didUpdate",{layout:n,snapshot:t,delta:a,layoutDelta:s,hasLayoutChanged:l,hasRelativeLayoutChanged:c})}else if(e.isLead()){const{onExitComplete:n}=e.options;n&&n()}e.options.transition=void 0}function nk(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function rk(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function ok(e){e.clearSnapshot()}function Yp(e){e.clearMeasurements()}function Xp(e){e.isLayoutDirty=!1}function ik(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Zp(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function sk(e){e.resolveTargetDelta()}function ak(e){e.calcProjection()}function lk(e){e.resetSkewAndRotation()}function ck(e){e.removeLeadSnapshot()}function Jp(e,t,n){e.translate=Je(t.translate,0,n),e.scale=Je(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Qp(e,t,n,r){e.min=Je(t.min,n.min,r),e.max=Je(t.max,n.max,r)}function uk(e,t,n,r){Qp(e.x,t.x,n.x,r),Qp(e.y,t.y,n.y,r)}function dk(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const fk={duration:.45,ease:[.4,0,.1,1]},em=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),tm=em("applewebkit/")&&!em("chrome/")?Math.round:cn;function nm(e){e.min=tm(e.min),e.max=tm(e.max)}function hk(e){nm(e.x),nm(e.y)}function Sb(e,t,n){return e==="position"||e==="preserve-aspect"&&!wR(Gp(t),Gp(n),.2)}function gk(e){return e!==e.root&&e.scroll?.wasRoot}const pk=Cb({attachResizeListener:(e,t)=>Vs(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Xc={current:void 0},_b=Cb({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Xc.current){const e=new pk({});e.mount(window),e.setOptions({layoutScroll:!0}),Xc.current=e}return Xc.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),mk={pan:{Feature:OR},drag:{Feature:$R,ProjectionNode:_b,MeasureLayout:mb}};function rm(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const o="onHover"+n,i=r[o];i&&Ue.postRender(()=>i(t,Qs(t)))}class yk extends Zr{mount(){const{current:t}=this.node;t&&(this.unmount=VE(t,(n,r)=>(rm(this.node,r,"Start"),o=>rm(this.node,o,"End"))))}unmount(){}}class vk extends Zr{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Xs(Vs(this.node.current,"focus",()=>this.onFocus()),Vs(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function om(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const o="onTap"+(n==="End"?"":n),i=r[o];i&&Ue.postRender(()=>i(t,Qs(t)))}class xk extends Zr{mount(){const{current:t}=this.node;t&&(this.unmount=WE(t,(n,r)=>(om(this.node,r,"Start"),(o,{success:i})=>om(this.node,o,i?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const kd=new WeakMap,Zc=new WeakMap,bk=e=>{const t=kd.get(e.target);t&&t(e)},wk=e=>{e.forEach(bk)};function Ck({root:e,...t}){const n=e||document;Zc.has(n)||Zc.set(n,{});const r=Zc.get(n),o=JSON.stringify(t);return r[o]||(r[o]=new IntersectionObserver(wk,{root:e,...t})),r[o]}function Sk(e,t,n){const r=Ck(t);return kd.set(e,n),r.observe(e),()=>{kd.delete(e),r.unobserve(e)}}const _k={some:0,all:1};class Tk extends Zr{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:o="some",once:i}=t,s={root:n?n.current:void 0,rootMargin:r,threshold:typeof o=="number"?o:_k[o]},a=l=>{const{isIntersecting:c}=l;if(this.isInView===c||(this.isInView=c,i&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",c);const{onViewportEnter:u,onViewportLeave:f}=this.node.getProps(),d=c?u:f;d&&d(l)};return Sk(this.node.current,s,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(Ek(t,n))&&this.startObserver()}unmount(){}}function Ek({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const Rk={inView:{Feature:Tk},tap:{Feature:xk},focus:{Feature:vk},hover:{Feature:yk}},kk={layout:{ProjectionNode:_b,MeasureLayout:mb}},Ak={...pR,...Rk,...mk,...kk},ea=M2(Ak,W2),yn={fontFamily:"Inter, sans-serif",wordBreak:"break-word"},ye={common:yn,title1:{...yn,fontSize:32,lineHeight:"36px",[vs.md()]:{fontSize:24}},title2:{...yn,fontSize:24,lineHeight:"28px",[vs.md()]:{fontSize:20}},title3:{...yn,fontSize:20,lineHeight:"28px",[vs.md()]:{fontSize:18},[vs.xs()]:{fontSize:16}},headline1:{...yn,fontSize:22,lineHeight:"26px"},headline2:{...yn,fontSize:18,lineHeight:"22px"},headline3:{...yn,fontSize:16,lineHeight:"20px"},body1:{...yn,fontSize:16,lineHeight:"24px"},body2:{...yn,fontSize:14,lineHeight:"20px"},caption1:{...yn,fontSize:12,lineHeight:"16px"},caption2:{...yn,fontSize:10,lineHeight:"14px"}},{transition:Nk,color:er,fontWeight:Ea}=V,Ra={text:T.css({...ye.common,transition:Nk.general}),"title-1":T.css({...ye.title1}),"title-2":T.css({...ye.title2}),"title-3":T.css({...ye.title3}),"headline-1":T.css({...ye.headline1}),"headline-2":T.css({...ye.headline2}),"headline-3":T.css({...ye.headline3}),"body-1":T.css({...ye.body1}),"body-2":T.css({...ye.body2}),"caption-1":T.css({...ye.caption1}),"caption-2":T.css({...ye.caption2}),primary:T.css({color:er.text.primary}),secondary:T.css({color:er.text.secondary}),tertiary:T.css({color:er.text.tertiary}),positive:T.css({color:er.text.positive}),negative:T.css({color:er.text.negative}),warning:T.css({color:er.text.warning}),accent:T.css({color:er.text.accent}),inverse:T.css({color:er.text.inverse}),transfer:T.css({color:er.text.transfer}),regular:T.css({fontWeight:Ea.regular}),medium:T.css({fontWeight:Ea.medium}),semibold:T.css({fontWeight:Ea.semibold}),bold:T.css({fontWeight:Ea.bold})},Mk=e=>{let t;e.center?t="center":e.left?t="left":e.right&&(t="right");let n;return e.uppercase?n="uppercase":e.lowercase?n="lowercase":e.capitalize&&(n="capitalize"),T.css({marginTop:e.mt,marginBottom:e.mb,marginRight:e.mr,marginLeft:e.ml,flex:e.flex,cursor:e.cursor,wordBreak:e.wordBreak,whiteSpace:e.whiteSpace,textOverflow:e.textOverflow,textDecoration:e.decoration,textAlign:t,textTransform:n,color:e.color,opacity:e.disabled?.5:void 0,overflow:e.overflow})},le=S.forwardRef(({children:e,className:t,variant:n="body-1",fontWeight:r="medium",tag:o="p",colorName:i="primary",style:s,clickOpacity:a=.5,opacityDuration:l=200,onClick:c,disabled:u,mt:f,mb:d,ml:h,mr:g,flex:p,cursor:m,wordBreak:v,whiteSpace:y,textOverflow:x,decoration:b,color:w,center:_,left:E,right:R,uppercase:k,lowercase:M,capitalize:F,overflow:D,...j},I)=>{const[$,H]=S.useState(!1),O=!!c,P=()=>O&&H(!0),K=()=>O&&H(!1),G=Mk({mt:f,mb:d,ml:h,mr:g,flex:p,cursor:m,wordBreak:v,whiteSpace:y,textOverflow:x,decoration:b,color:w,center:_,left:E,right:R,uppercase:k,lowercase:M,capitalize:F,overflow:D}),re=o,U=O?T.css({opacity:$?a:1,transition:`opacity ${l}ms ease`}):"";return C.jsx(re,{ref:I,...j,className:T.cx(Ra.text,Ra[n],Ra[i],Ra[r],U,t,G),style:s,onClick:c,onMouseDown:P,onMouseUp:K,onMouseLeave:K,onTouchStart:P,onTouchEnd:K,role:O?"button":void 0,tabIndex:O?0:void 0,children:e})});le.displayName="Text";const Tb=ea(le),{color:Ad,cornerRadius:Yt,height:ka,transition:Pk}=V,Lk=T.css({display:"flex",alignItems:"center",justifyContent:"center",position:"relative",borderRadius:16,height:48,padding:"0 16px",cursor:"pointer",fontSize:16,fontWeight:600,overflow:"hidden",transition:"all 0.2s ease",gap:8}),as={zero:Yt.zero,xs:Yt.xs,sm:Yt.sm,md:Yt.md,lg:Yt.lg,xl:Yt.xl,"2xl":Yt["2xl"],"3xl":Yt["3xl"],"4xl":Yt["4xl"],"5xl":Yt["5xl"],"6xl":Yt["6xl"],"full-round":Yt.fullRound},Fk={xs:ka.button.xs,sm:ka.button.sm,md:ka.button.md,lg:ka.button.lg},$k={clear:T.css({backgroundColor:"transparent",border:"none"}),filled:T.css({backgroundColor:Ad.fill.accentPrimary,color:"white",border:"none"}),outline:T.css({backgroundColor:"transparent",border:`1px solid ${Ad.border.accentPrimary}`})},Ok=(e,t,n,r)=>{if(r)return T.css({cursor:"not-allowed",opacity:.7});const o={transition:Pk.general,borderRadius:Yt.lg,border:"none",color:e==="filled"?Ad.text.inverse:`var(--text-${t})`};switch(e){case"filled":return T.css({...o,backgroundColor:`var(--fill-${t}-${n})`,":hover":{backgroundColor:`var(--fill-${t}-${n}-hover)`},":active":{backgroundColor:`var(--fill-${t}-${n}-hover)`}});case"outline":return T.css({...o,backgroundColor:"transparent",border:`1px solid var(--border-${t}-${n})`,":hover":{backgroundColor:`var(--fill-${t}-secondary-hover)`},":active":{backgroundColor:`var(--fill-${t}-secondary-hover)`}});case"clear":return T.css({...o,backgroundColor:"transparent",":hover":{backgroundColor:`var(--fill-${t}-secondary-hover)`},":active":{backgroundColor:`var(--fill-${t}-secondary-hover)`}});default:return T.css(o)}},{color:Aa}=V,Br=({disabled:e,loading:t,className:n,wrapperClassName:r,buttonClassName:o,buttonDisabledClassName:i,textClassName:s,children:a,variant:l="filled",backgroundColor:c,textColor:u,textFontWeight:f,borderColor:d,color:h="accent",opacity:g,borderRadius:p,width:m="full",size:v="md",iconLeft:y,iconRight:x,intensity:b="primary",flex:w,type:_="button",...E})=>{const R=S.useMemo(()=>{switch(m){case"full":return"100%";case"auto":return"auto";default:return m}},[m]),k=S.useMemo(()=>c||(l==="filled"?h==="neutral"?Aa.fill.neutralSecondary:`var(--fill-${h}-${b})`:"transparent"),[l,c,h,b]),M=S.useMemo(()=>{if(b==="primary"){if(h==="neutral")return Aa.text.secondary;if(l==="filled")return Aa.text.inverse}else if(h==="neutral")return Aa.text.secondary;return`var(--text-${h})`},[b,h,l]),F=S.useMemo(()=>{if(b==="primary"){if(h==="neutral")return"secondary";if(l==="filled")return"inverse"}else if(h==="neutral")return"secondary";return h},[l,h,b]),D=S.useMemo(()=>d||(l==="outline"?`var(--border-${h}-${b})`:"transparent"),[l,d,h,b]),j=S.useMemo(()=>{switch(v){case"lg":return as.lg;case"md":case"sm":return as.md;case"xs":return as.sm;default:return as.md}},[v]),I=T.cx(Lk,Ok(l,h,b,e),$k[l],e?i:void 0,T.css({borderRadius:p?as[p]:j,backgroundColor:k,borderColor:D,color:u??`var(--text-${F})`,width:"100%",height:Fk[v],opacity:g||(e?.7:1)}),o),$=S.useMemo(()=>{switch(v){case"lg":case"md":return"body-1";case"sm":case"xs":return"body-2";default:return"body-1"}},[v]);return C.jsx(q,{className:T.cx(r,n),w:R,flex:w,relative:!0,overflow:"hidden",children:C.jsxs(ea.button,{...E,whileTap:!e&&!t?{scale:.99,boxShadow:"inset 0 0 0 10000px rgba(0,0,0,0.1)",transition:{duration:0}}:{},disabled:e||t,className:I,type:_,children:[t?C.jsx(V0,{color:M}):C.jsxs(C.Fragment,{children:[y,C.jsx(Tb,{style:{color:u},colorName:F,variant:$,className:s,textOverflow:"ellipsis",overflow:"hidden",children:a}),x]}),C.jsx(zo,{})]})})},Ik=e=>N.createElement("svg",{width:16,height:16,viewBox:"0 0 24 24",fill:"none",...e},N.createElement("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z",fill:"currentColor"})),Dk=e=>N.createElement("svg",{viewBox:"0 0 24 24",fill:"none",...e},N.createElement("path",{d:"M19 13H5v-2h14v2z",fill:"currentColor"})),{color:ao}=V,Sr={checkbox:T.css({display:"inline-flex",alignItems:"flex-start",gap:8,userSelect:"none"}),disabled:T.css({cursor:"not-allowed",opacity:.5}),checkbox__input:T.css({position:"absolute",opacity:0,width:"var(--checkbox-size)",height:"var(--checkbox-size)"}),checkbox__box:T.css({width:"var(--checkbox-size)",height:"var(--checkbox-size)",display:"inline-flex",alignItems:"center",justifyContent:"center",borderRadius:4,border:`1px solid ${ao.border.neutralAlphaHigh}`,backgroundColor:ao.fill.bgSecondary,opacity:1,transition:"all 0.15s cubic-bezier(0.4, 0, 0.2, 1)",position:"relative","& svg":{color:ao.border.accentPrimary}}),checked:T.css({borderColor:`${ao.border.accentPrimary} !important`,backgroundColor:`${ao.fill.accentSecondary} !important`}),error:T.css({borderColor:ao.border.negativePrimary,backgroundColor:ao.fill.negativeSecondary})},jk={primary:T.css({}),secondary:T.css({backgroundColor:"transparent"})},Vk={sm:20,md:24},hh=S.forwardRef(({checked:e,onChange:t,disabled:n,error:r,indeterminate:o,size:i="md",title:s,titleColor:a,subtitle:l,subtitleColor:c="secondary",name:u,required:f,variant:d="primary",flex:h,readOnly:g,className:p,inputClassName:m,boxClassName:v,titleClassName:y,subtitleClassName:x},b)=>{const[w,_]=S.useState(!1),E=e!==void 0,R=E?e:w,k=I=>{E||_(I.target.checked),t?.(I)},M=Vk[i],F=R||o,D=!!g&&!n,j=n?"not-allowed":D?"auto":"pointer";return C.jsxs("label",{className:T.cx(Sr.checkbox,T.css({flex:h,cursor:j}),{[Sr.disabled]:n},p),children:[C.jsxs(q,{relative:!0,display:"inline-flex",style:{"--checkbox-size":`${M}px`,"--checkbox-size-double":`${M*2}px`},children:[C.jsx("input",{ref:b,type:"checkbox",checked:R,onChange:D?void 0:k,onClick:I=>I.stopPropagation(),disabled:n,readOnly:D,name:u,required:f,className:T.cx(Sr.checkbox__input,{[Sr.disabled]:n},T.css({cursor:j}),m)}),C.jsx("div",{className:T.cx(Sr.checkbox__box,jk[d],{[Sr.disabled]:n,[Sr.error]:r,[Sr.checked]:F},v),children:F&&(o?C.jsx(Dk,{width:M*.75,height:M*.75}):C.jsx(Ik,{width:M*.75,height:M*.75}))})]}),(s||l)&&C.jsxs(q,{gap:4,children:[s&&C.jsx(le,{colorName:a,variant:i==="sm"?"body-2":"body-1",className:y,children:s}),l&&C.jsx(le,{variant:"body-2",colorName:c,className:x,children:l})]})]})});hh.displayName="Checkbox";const Bk=e=>N.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("g",{opacity:.5},N.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.0002 17.9999C14.4185 17.9999 18.0002 14.4182 18.0002 9.99991C18.0002 5.58163 14.4185 1.99991 10.0002 1.99991C5.58197 1.99991 2.00024 5.58163 2.00024 9.99991C2.00024 14.4182 5.58197 17.9999 10.0002 17.9999ZM6.46514 6.46446C6.85566 6.07393 7.48883 6.07393 7.87935 6.46446L9.64712 8.23222C9.84238 8.42749 10.159 8.42749 10.3542 8.23222L12.122 6.46446C12.5125 6.07393 13.1457 6.07393 13.5362 6.46446C13.9267 6.85498 13.9267 7.48814 13.5362 7.87867L11.7684 9.64644C11.5732 9.8417 11.5732 10.1583 11.7684 10.3535L13.5362 12.1213C13.9267 12.5118 13.9267 13.145 13.5362 13.5355C13.1457 13.926 12.5125 13.926 12.122 13.5355L10.3542 11.7678C10.159 11.5725 9.84238 11.5725 9.64712 11.7678L7.87935 13.5355C7.48883 13.926 6.85566 13.926 6.46514 13.5355C6.07462 13.145 6.07462 12.5118 6.46514 12.1213L8.23291 10.3535C8.42817 10.1583 8.42817 9.8417 8.23291 9.64644L6.46514 7.87867C6.07462 7.48815 6.07462 6.85498 6.46514 6.46446Z",fill:"currentColor"}))),{color:en,spacing:ls}=V,Jc=T.css({opacity:.6,cursor:"not-allowed"}),xt={"input-container":T.css({backgroundColor:en.fill.accentSecondary,border:`1px solid ${en.border.neutralAlphaBasic}`,padding:`${ls.md} ${ls.lg}`,borderRadius:12,minHeight:40,width:"100%",transition:"border-color 0.2s ease, background-color 0.2s ease","& textarea":{resize:"none"},[`&:not(.${Jc}):hover`]:{backgroundColor:en.fill.neutralPrimaryHover},"&:focus-within":{borderColor:en.border.accentPrimary,[`&:not(.${Jc}):hover`]:{borderColor:en.border.accentPrimary}}}),input:T.css({...ye.common,...ye.body1,background:"transparent",width:"100%",color:en.text.primary,"&::placeholder":{color:en.text.tertiary,textOverflow:"ellipsis"}}),"input-text-size_sm":T.css({...ye.body2}),"input-text-size_md":T.css({...ye.body2}),"input-text-align_left":T.css({textAlign:"left"}),"input-text-align_center":T.css({textAlign:"center"}),"input-text-align_right":T.css({textAlign:"right"}),sm:T.css({height:40,padding:ls.md}),md:T.css({height:48,padding:`14px ${ls.lg} 14px ${ls.lg}`}),error:T.css({borderColor:en.border.negativePrimary}),disabled:Jc,multiline:T.css({height:"auto"}),primary:T.css({background:en.fill.bgPrimary}),secondary:T.css({background:en.fill.bgSecondary}),"clear-button":T.css({cursor:"pointer",color:en.text.tertiary,height:20,"&:hover":{color:en.text.primary}})},{spacing:im}=V;function sm(e){return{...new Event("input",{bubbles:!0}),target:e,currentTarget:e}}const Fi=S.forwardRef((e,t)=>{const{label:n,prompt:r,error:o,errorText:i,size:s="md",prefix:a,suffix:l,background:c="primary",showClearButton:u,disabled:f,value:d,defaultValue:h,className:g,wrapperClassName:p,labelClassName:m,fieldContainerClassName:v,promptClassName:y,errorClassName:x,textAlign:b="left",...w}=e,_=e.multiline===!0,E=S.useRef(null),R=S.useRef(null),[k,M]=Bo(typeof d=="string"||typeof d=="number"?String(d):void 0,typeof h=="string"||typeof h=="number"?String(h):"");S.useImperativeHandle(t,()=>({focus:()=>{E.current?.focus(),R.current?.focus()},blur:()=>{E.current?.blur(),R.current?.blur()},get value(){return E.current?.value||R.current?.value},set value($){M($),E.current&&(E.current.value=$),R.current&&(R.current.value=$)}}));const F=$=>{if(M($.target.value),_){const H=e.onChange;H?.($)}else{const H=e.onChange;H?.($)}};S.useEffect(()=>{_&&e.autoResize&&R.current&&(R.current.style.height="auto",R.current.style.height=`${R.current.scrollHeight}px`)},[k,_,e.autoResize]);const D=()=>{if(M(""),!_){const H=E.current;if(H){H.value="";const O=sm(H),P=e.onChange;P?.(O)}return}const $=R.current;if($){$.value="";const H=sm($),O=e.onChange;O?.(H)}},j=()=>{if(_){const{rows:P,autoResize:K,onChange:G,multiline:re,...U}=w;return C.jsx("textarea",{ref:R,rows:e.rows??3,className:T.cx(xt.input,g,{[xt.disabled]:f,[xt[`input-text-align_${b}`]]:!!b}),disabled:f,maxLength:e.maxLength,...U,value:k,onChange:F})}const{onChange:$,multiline:H,...O}=w;return C.jsx("input",{...O,ref:E,className:T.cx(xt.input,xt[`input-text-size_${s}`],g,{[xt.disabled]:f,[xt[`input-text-align_${b}`]]:!!b}),disabled:f,type:e.type??"text",value:k,onChange:F})},I=S.useMemo(()=>c==="white"?xt.primary:c==="gray"?xt.secondary:xt[c],[c]);return C.jsxs(q,{w:"full",gap:im.sm,className:p,children:[typeof n=="string"?C.jsx(le,{variant:"body-2",fontWeight:"regular",colorName:"tertiary",className:m,children:n}):n,C.jsxs(q,{row:!0,alignItems:_?"flex-start":"center",w:"full",gap:im.md,className:T.cx(xt["input-container"],I,xt[s],{[xt.error]:o,[xt.disabled]:f,[xt.multiline]:_},v),children:[a&&C.jsx(q,{flex:"none",children:a}),C.jsx(q,{flex:"1",children:j()}),u&&k&&!f&&C.jsx(q,{flex:"none",children:C.jsx("span",{className:xt["clear-button"],onClick:D,children:C.jsx(Bk,{})})}),l&&C.jsx(q,{flex:"none",children:l})]}),(r||_)&&C.jsxs(q,{row:!0,gap:10,w:"full",children:[typeof r=="string"?C.jsx(le,{variant:"caption-1",colorName:"tertiary",className:y,children:r}):r,_&&e.maxLength&&C.jsx(le,{right:!0,ml:"auto",flex:"none",variant:"caption-1",colorName:"tertiary",children:`${k.length}/${e.maxLength}`})]}),i&&o&&C.jsx(le,{variant:"body-2",colorName:"negative",fontWeight:"regular",className:x,children:i})]})});Fi.displayName="Input";const zk=e=>N.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M15 8.33333H5M17.5 5H2.5M17.5 11.6667H2.5M15 15H5",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),Hk=e=>N.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M13.3333 8.33333H2.5M16.6667 5H2.5M16.6667 11.6667H2.5M13.3333 15H2.5",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),Wk=e=>N.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M17.5 8.33333H6.66665M17.5 5H3.33331M17.5 11.6667H3.33331M17.5 15H6.66665",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),Kk=e=>N.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M5 10H11.6667C13.5076 10 15 8.50766 15 6.66671C15 4.82576 13.5076 3.33337 11.6667 3.33337H5V10ZM5 10H12.5C14.3409 10 15.8333 11.4924 15.8333 13.3334C15.8333 15.1743 14.3409 16.6667 12.5 16.6667H5V10Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),Uk=e=>N.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M13.5 17.5H5.77614C5.2713 17.5 5.01887 17.5 4.90199 17.4002C4.80056 17.3135 4.74674 17.1836 4.75721 17.0506C4.76927 16.8974 4.94776 16.7189 5.30474 16.3619L12.3905 9.27614C12.7205 8.94613 12.8855 8.78112 13.0758 8.7193C13.2432 8.66492 13.4235 8.66492 13.5908 8.7193C13.7811 8.78112 13.9461 8.94613 14.2761 9.27614L17.5 12.5V13.5M13.5 17.5C14.9001 17.5 15.6002 17.5 16.135 17.2275C16.6054 16.9878 16.9878 16.6054 17.2275 16.135C17.5 15.6002 17.5 14.9001 17.5 13.5M13.5 17.5H6.5C5.09987 17.5 4.3998 17.5 3.86502 17.2275C3.39462 16.9878 3.01217 16.6054 2.77248 16.135C2.5 15.6002 2.5 14.9001 2.5 13.5V6.5C2.5 5.09987 2.5 4.3998 2.77248 3.86502C3.01217 3.39462 3.39462 3.01217 3.86502 2.77248C4.3998 2.5 5.09987 2.5 6.5 2.5H13.5C14.9001 2.5 15.6002 2.5 16.135 2.77248C16.6054 3.01217 16.9878 3.39462 17.2275 3.86502C17.5 4.3998 17.5 5.09987 17.5 6.5V13.5M8.75 7.08333C8.75 8.00381 8.00381 8.75 7.08333 8.75C6.16286 8.75 5.41667 8.00381 5.41667 7.08333C5.41667 6.16286 6.16286 5.41667 7.08333 5.41667C8.00381 5.41667 8.75 6.16286 8.75 7.08333Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),Gk=e=>N.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M15.8334 3.33337H8.33335M11.6667 16.6667H4.16669M12.5 3.33337L7.50002 16.6667",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),qk=e=>N.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("g",{clipPath:"url(#clip0_1571_1710)"},N.createElement("path",{d:"M8.33332 10.8333C8.69119 11.3118 9.14778 11.7077 9.67211 11.9941C10.1964 12.2806 10.7762 12.4509 11.3722 12.4936C11.9681 12.5363 12.5663 12.4503 13.1261 12.2415C13.6859 12.0327 14.1942 11.7059 14.6167 11.2833L17.1167 8.78335C17.8756 7.9975 18.2956 6.94499 18.2861 5.85251C18.2766 4.76002 17.8384 3.71497 17.0659 2.94243C16.2934 2.1699 15.2483 1.7317 14.1558 1.7222C13.0633 1.71271 12.0108 2.13269 11.225 2.89168L9.79165 4.31668M11.6666 9.16668C11.3088 8.68824 10.8522 8.29236 10.3279 8.0059C9.80353 7.71943 9.22373 7.54908 8.62777 7.5064C8.03182 7.46372 7.43366 7.54971 6.87386 7.75853C6.31406 7.96735 5.80572 8.29412 5.38332 8.71668L2.88332 11.2167C2.12432 12.0025 1.70435 13.055 1.71384 14.1475C1.72334 15.24 2.16154 16.2851 2.93407 17.0576C3.70661 17.8301 4.75166 18.2683 5.84414 18.2778C6.93663 18.2873 7.98914 17.8673 8.77498 17.1083L10.2 15.6833",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),N.createElement("defs",null,N.createElement("clipPath",{id:"clip0_1571_1710"},N.createElement("rect",{width:20,height:20,fill:"white"})))),Yk=e=>N.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M17.5 9.99996L7.5 9.99996M17.5 4.99996L7.5 4.99996M17.5 15L7.5 15M4.16667 9.99996C4.16667 10.4602 3.79357 10.8333 3.33333 10.8333C2.8731 10.8333 2.5 10.4602 2.5 9.99996C2.5 9.53972 2.8731 9.16663 3.33333 9.16663C3.79357 9.16663 4.16667 9.53972 4.16667 9.99996ZM4.16667 4.99996C4.16667 5.4602 3.79357 5.83329 3.33333 5.83329C2.8731 5.83329 2.5 5.4602 2.5 4.99996C2.5 4.53972 2.8731 4.16663 3.33333 4.16663C3.79357 4.16663 4.16667 4.53972 4.16667 4.99996ZM4.16667 15C4.16667 15.4602 3.79357 15.8333 3.33333 15.8333C2.8731 15.8333 2.5 15.4602 2.5 15C2.5 14.5397 2.8731 14.1666 3.33333 14.1666C3.79357 14.1666 4.16667 14.5397 4.16667 15Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),Xk=e=>N.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M14 8.74967C14.4142 8.74967 14.75 8.41389 14.75 7.99967C14.75 7.58546 14.4142 7.24967 14 7.24967V7.99967V8.74967ZM6 7.24967C5.58579 7.24967 5.25 7.58546 5.25 7.99967C5.25 8.41389 5.58579 8.74967 6 8.74967V7.99967V7.24967ZM14 4.74967C14.4142 4.74967 14.75 4.41389 14.75 3.99967C14.75 3.58546 14.4142 3.24967 14 3.24967V3.99967V4.74967ZM6 3.24967C5.58579 3.24967 5.25 3.58546 5.25 3.99967C5.25 4.41389 5.58579 4.74967 6 4.74967V3.99967V3.24967ZM14 12.7497C14.4142 12.7497 14.75 12.4139 14.75 11.9997C14.75 11.5855 14.4142 11.2497 14 11.2497V11.9997V12.7497ZM6 11.2497C5.58579 11.2497 5.25 11.5855 5.25 11.9997C5.25 12.4139 5.58579 12.7497 6 12.7497V11.9997V11.2497ZM1.58967 3.48952C1.24295 3.71614 1.14558 4.18092 1.3722 4.52765C1.59882 4.87437 2.0636 4.97174 2.41033 4.74512L2 4.11732L1.58967 3.48952ZM3.2 3.33301H3.95C3.95 3.05764 3.79909 2.80441 3.5569 2.67337C3.31471 2.54233 3.02018 2.55455 2.78967 2.70521L3.2 3.33301ZM2.4 5.91634C1.98579 5.91634 1.65 6.25213 1.65 6.66634C1.65 7.08055 1.98579 7.41634 2.4 7.41634V6.66634V5.91634ZM4 7.41634C4.41421 7.41634 4.75 7.08055 4.75 6.66634C4.75 6.25213 4.41421 5.91634 4 5.91634V6.66634V7.41634ZM3.73743 10.8967L4.2726 11.4222L4.2726 11.4222L3.73743 10.8967ZM2 12.6663L1.46483 12.1409C1.25318 12.3565 1.19153 12.678 1.30841 12.9565C1.4253 13.2351 1.69791 13.4163 2 13.4163V12.6663ZM4 13.4163C4.41421 13.4163 4.75 13.0806 4.75 12.6663C4.75 12.2521 4.41421 11.9163 4 11.9163V12.6663V13.4163ZM1.25 10.2589C1.25 10.6731 1.58579 11.0089 2 11.0089C2.41421 11.0089 2.75 10.6731 2.75 10.2589H2H1.25ZM14 7.99967V7.24967L6 7.24967V7.99967V8.74967L14 8.74967V7.99967ZM14 3.99967V3.24967H6V3.99967V4.74967H14V3.99967ZM14 11.9997V11.2497L6 11.2497V11.9997V12.7497L14 12.7497V11.9997ZM2 4.11732L2.41033 4.74512L3.61033 3.96081L3.2 3.33301L2.78967 2.70521L1.58967 3.48952L2 4.11732ZM3.2 3.33301H2.45V6.66634H3.2H3.95V3.33301H3.2ZM3.2 6.66634V5.91634H2.4V6.66634V7.41634H3.2V6.66634ZM3.2 6.66634V7.41634H4V6.66634V5.91634H3.2V6.66634ZM3.73743 10.8967L3.20226 10.3713L1.46483 12.1409L2 12.6663L2.53517 13.1918L4.2726 11.4222L3.73743 10.8967ZM2 12.6663V13.4163H4V12.6663V11.9163H2V12.6663ZM4 10.2654H3.25C3.25 10.2957 3.23759 10.3353 3.20225 10.3713L3.73743 10.8967L4.2726 11.4222C4.57518 11.114 4.75 10.7002 4.75 10.2654H4ZM3 9.33301V10.083C3.08406 10.083 3.1515 10.1147 3.19493 10.1553C3.23791 10.1955 3.25 10.2354 3.25 10.2654H4H4.75C4.75 9.29296 3.91808 8.58301 3 8.58301V9.33301ZM2 10.2589H2.75C2.75 10.2299 2.76126 10.1927 2.80245 10.1545C2.84462 10.1155 2.91258 10.083 3 10.083V9.33301V8.58301C2.0889 8.58301 1.25 9.28004 1.25 10.2589H2Z",fill:"currentColor"})),Zk=e=>N.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M5 13.3334C5 15.1743 6.49238 16.6667 8.33333 16.6667H11.6667C13.5076 16.6667 15 15.1743 15 13.3334C15 11.4924 13.5076 10 11.6667 10M15 6.66671C15 4.82576 13.5076 3.33337 11.6667 3.33337H8.33333C6.49238 3.33337 5 4.82576 5 6.66671M2.5 10H17.5",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),Jk=e=>N.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M2.5 7.5L17.5 7.5M7.5 2.5L7.5 17.5M6.5 2.5H13.5C14.9001 2.5 15.6002 2.5 16.135 2.77248C16.6054 3.01217 16.9878 3.39462 17.2275 3.86502C17.5 4.3998 17.5 5.09987 17.5 6.5V13.5C17.5 14.9001 17.5 15.6002 17.2275 16.135C16.9878 16.6054 16.6054 16.9878 16.135 17.2275C15.6002 17.5 14.9001 17.5 13.5 17.5H6.5C5.09987 17.5 4.3998 17.5 3.86502 17.2275C3.39462 16.9878 3.01217 16.6054 2.77248 16.135C2.5 15.6002 2.5 14.9001 2.5 13.5V6.5C2.5 5.09987 2.5 4.3998 2.77248 3.86502C3.01217 3.39462 3.39462 3.01217 3.86502 2.77248C4.3998 2.5 5.09987 2.5 6.5 2.5Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),Qk=e=>N.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M15 3.33337V9.16671C15 11.9281 12.7614 14.1667 9.99998 14.1667C7.23856 14.1667 4.99998 11.9281 4.99998 9.16671V3.33337M3.33331 17.5H16.6666",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),gh=S.createContext(null);function ta(){const e=S.useContext(gh);if(!e)throw new Error("useEditorStates must be used within EditorState Provider");return e}const Eb=S.createContext(null);function e3(){const e=S.useContext(Eb);if(!e)throw new Error("useToolbarContext must be used within ToolbarContext provider");return e}var bs={exports:{}};bs.exports;var am;function t3(){return am||(am=1,(function(e,t){var n=200,r="__lodash_hash_undefined__",o=800,i=16,s=9007199254740991,a="[object Arguments]",l="[object Array]",c="[object AsyncFunction]",u="[object Boolean]",f="[object Date]",d="[object Error]",h="[object Function]",g="[object GeneratorFunction]",p="[object Map]",m="[object Number]",v="[object Null]",y="[object Object]",x="[object Proxy]",b="[object RegExp]",w="[object Set]",_="[object String]",E="[object Undefined]",R="[object WeakMap]",k="[object ArrayBuffer]",M="[object DataView]",F="[object Float32Array]",D="[object Float64Array]",j="[object Int8Array]",I="[object Int16Array]",$="[object Int32Array]",H="[object Uint8Array]",O="[object Uint8ClampedArray]",P="[object Uint16Array]",K="[object Uint32Array]",G=/[\\^$.*+?()[\]{}|]/g,re=/^\[object .+?Constructor\]$/,U=/^(?:0|[1-9]\d*)$/,Z={};Z[F]=Z[D]=Z[j]=Z[I]=Z[$]=Z[H]=Z[O]=Z[P]=Z[K]=!0,Z[a]=Z[l]=Z[k]=Z[u]=Z[M]=Z[f]=Z[d]=Z[h]=Z[p]=Z[m]=Z[y]=Z[b]=Z[w]=Z[_]=Z[R]=!1;var Q=typeof Bn=="object"&&Bn&&Bn.Object===Object&&Bn,ne=typeof self=="object"&&self&&self.Object===Object&&self,oe=Q||ne||Function("return this")(),me=t&&!t.nodeType&&t,ee=me&&!0&&e&&!e.nodeType&&e,xe=ee&&ee.exports===me,Se=xe&&Q.process,Ee=(function(){try{var A=ee&&ee.require&&ee.require("util").types;return A||Se&&Se.binding&&Se.binding("util")}catch{}})(),ze=Ee&&Ee.isTypedArray;function je(A,L,z){switch(z.length){case 0:return A.call(L);case 1:return A.call(L,z[0]);case 2:return A.call(L,z[0],z[1]);case 3:return A.call(L,z[0],z[1],z[2])}return A.apply(L,z)}function Rt(A,L){for(var z=-1,ie=Array(A);++z<A;)ie[z]=L(z);return ie}function gn(A){return function(L){return A(L)}}function ot(A,L){return A?.[L]}function Gt(A,L){return function(z){return A(L(z))}}var Qt=Array.prototype,pt=Function.prototype,se=Object.prototype,Re=oe["__core-js_shared__"],Ye=pt.toString,rt=se.hasOwnProperty,It=(function(){var A=/[^.]+$/.exec(Re&&Re.keys&&Re.keys.IE_PROTO||"");return A?"Symbol(src)_1."+A:""})(),to=se.toString,no=Ye.call(Object),pa=RegExp("^"+Ye.call(rt).replace(G,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),qo=xe?oe.Buffer:void 0,Ce=oe.Symbol,Le=oe.Uint8Array;qo&&qo.allocUnsafe;var Yo=Gt(Object.getPrototypeOf,Object),kg=Object.create,_S=se.propertyIsEnumerable,TS=Qt.splice,ro=Ce?Ce.toStringTag:void 0,ma=(function(){try{var A=Rc(Object,"defineProperty");return A({},"",{}),A}catch{}})(),ES=qo?qo.isBuffer:void 0,Ag=Math.max,RS=Date.now,Ng=Rc(oe,"Map"),rs=Rc(Object,"create"),kS=(function(){function A(){}return function(L){if(!io(L))return{};if(kg)return kg(L);A.prototype=L;var z=new A;return A.prototype=void 0,z}})();function oo(A){var L=-1,z=A==null?0:A.length;for(this.clear();++L<z;){var ie=A[L];this.set(ie[0],ie[1])}}function AS(){this.__data__=rs?rs(null):{},this.size=0}function NS(A){var L=this.has(A)&&delete this.__data__[A];return this.size-=L?1:0,L}function MS(A){var L=this.__data__;if(rs){var z=L[A];return z===r?void 0:z}return rt.call(L,A)?L[A]:void 0}function PS(A){var L=this.__data__;return rs?L[A]!==void 0:rt.call(L,A)}function LS(A,L){var z=this.__data__;return this.size+=this.has(A)?0:1,z[A]=rs&&L===void 0?r:L,this}oo.prototype.clear=AS,oo.prototype.delete=NS,oo.prototype.get=MS,oo.prototype.has=PS,oo.prototype.set=LS;function Qn(A){var L=-1,z=A==null?0:A.length;for(this.clear();++L<z;){var ie=A[L];this.set(ie[0],ie[1])}}function FS(){this.__data__=[],this.size=0}function $S(A){var L=this.__data__,z=ya(L,A);if(z<0)return!1;var ie=L.length-1;return z==ie?L.pop():TS.call(L,z,1),--this.size,!0}function OS(A){var L=this.__data__,z=ya(L,A);return z<0?void 0:L[z][1]}function IS(A){return ya(this.__data__,A)>-1}function DS(A,L){var z=this.__data__,ie=ya(z,A);return ie<0?(++this.size,z.push([A,L])):z[ie][1]=L,this}Qn.prototype.clear=FS,Qn.prototype.delete=$S,Qn.prototype.get=OS,Qn.prototype.has=IS,Qn.prototype.set=DS;function Xo(A){var L=-1,z=A==null?0:A.length;for(this.clear();++L<z;){var ie=A[L];this.set(ie[0],ie[1])}}function jS(){this.size=0,this.__data__={hash:new oo,map:new(Ng||Qn),string:new oo}}function VS(A){var L=xa(this,A).delete(A);return this.size-=L?1:0,L}function BS(A){return xa(this,A).get(A)}function zS(A){return xa(this,A).has(A)}function HS(A,L){var z=xa(this,A),ie=z.size;return z.set(A,L),this.size+=z.size==ie?0:1,this}Xo.prototype.clear=jS,Xo.prototype.delete=VS,Xo.prototype.get=BS,Xo.prototype.has=zS,Xo.prototype.set=HS;function Zo(A){var L=this.__data__=new Qn(A);this.size=L.size}function WS(){this.__data__=new Qn,this.size=0}function KS(A){var L=this.__data__,z=L.delete(A);return this.size=L.size,z}function US(A){return this.__data__.get(A)}function GS(A){return this.__data__.has(A)}function qS(A,L){var z=this.__data__;if(z instanceof Qn){var ie=z.__data__;if(!Ng||ie.length<n-1)return ie.push([A,L]),this.size=++z.size,this;z=this.__data__=new Xo(ie)}return z.set(A,L),this.size=z.size,this}Zo.prototype.clear=WS,Zo.prototype.delete=KS,Zo.prototype.get=US,Zo.prototype.has=GS,Zo.prototype.set=qS;function YS(A,L){var z=Nc(A),ie=!z&&Ac(A),_e=!z&&!ie&&$g(A),Oe=!z&&!ie&&!_e&&Ig(A),He=z||ie||_e||Oe,Ae=He?Rt(A.length,String):[],We=Ae.length;for(var pn in A)He&&(pn=="length"||_e&&(pn=="offset"||pn=="parent")||Oe&&(pn=="buffer"||pn=="byteLength"||pn=="byteOffset")||Lg(pn,We))||Ae.push(pn);return Ae}function Tc(A,L,z){(z!==void 0&&!ba(A[L],z)||z===void 0&&!(L in A))&&Ec(A,L,z)}function XS(A,L,z){var ie=A[L];(!(rt.call(A,L)&&ba(ie,z))||z===void 0&&!(L in A))&&Ec(A,L,z)}function ya(A,L){for(var z=A.length;z--;)if(ba(A[z][0],L))return z;return-1}function Ec(A,L,z){L=="__proto__"&&ma?ma(A,L,{configurable:!0,enumerable:!0,value:z,writable:!0}):A[L]=z}var ZS=u_();function va(A){return A==null?A===void 0?E:v:ro&&ro in Object(A)?d_(A):y_(A)}function Mg(A){return os(A)&&va(A)==a}function JS(A){if(!io(A)||p_(A))return!1;var L=Pc(A)?pa:re;return L.test(w_(A))}function QS(A){return os(A)&&Og(A.length)&&!!Z[va(A)]}function e_(A){if(!io(A))return m_(A);var L=Fg(A),z=[];for(var ie in A)ie=="constructor"&&(L||!rt.call(A,ie))||z.push(ie);return z}function Pg(A,L,z,ie,_e){A!==L&&ZS(L,function(Oe,He){if(_e||(_e=new Zo),io(Oe))t_(A,L,He,z,Pg,ie,_e);else{var Ae=ie?ie(kc(A,He),Oe,He+"",A,L,_e):void 0;Ae===void 0&&(Ae=Oe),Tc(A,He,Ae)}},Dg)}function t_(A,L,z,ie,_e,Oe,He){var Ae=kc(A,z),We=kc(L,z),pn=He.get(We);if(pn){Tc(A,z,pn);return}var qt=Oe?Oe(Ae,We,z+"",A,L,He):void 0,is=qt===void 0;if(is){var Lc=Nc(We),Fc=!Lc&&$g(We),Vg=!Lc&&!Fc&&Ig(We);qt=We,Lc||Fc||Vg?Nc(Ae)?qt=Ae:C_(Ae)?qt=a_(Ae):Fc?(is=!1,qt=o_(We)):Vg?(is=!1,qt=s_(We)):qt=[]:S_(We)||Ac(We)?(qt=Ae,Ac(Ae)?qt=__(Ae):(!io(Ae)||Pc(Ae))&&(qt=f_(We))):is=!1}is&&(He.set(We,qt),_e(qt,We,ie,Oe,He),He.delete(We)),Tc(A,z,qt)}function n_(A,L){return x_(v_(A,L,jg),A+"")}var r_=ma?function(A,L){return ma(A,"toString",{configurable:!0,enumerable:!1,value:E_(L),writable:!0})}:jg;function o_(A,L){return A.slice()}function i_(A){var L=new A.constructor(A.byteLength);return new Le(L).set(new Le(A)),L}function s_(A,L){var z=i_(A.buffer);return new A.constructor(z,A.byteOffset,A.length)}function a_(A,L){var z=-1,ie=A.length;for(L||(L=Array(ie));++z<ie;)L[z]=A[z];return L}function l_(A,L,z,ie){var _e=!z;z||(z={});for(var Oe=-1,He=L.length;++Oe<He;){var Ae=L[Oe],We=void 0;We===void 0&&(We=A[Ae]),_e?Ec(z,Ae,We):XS(z,Ae,We)}return z}function c_(A){return n_(function(L,z){var ie=-1,_e=z.length,Oe=_e>1?z[_e-1]:void 0,He=_e>2?z[2]:void 0;for(Oe=A.length>3&&typeof Oe=="function"?(_e--,Oe):void 0,He&&h_(z[0],z[1],He)&&(Oe=_e<3?void 0:Oe,_e=1),L=Object(L);++ie<_e;){var Ae=z[ie];Ae&&A(L,Ae,ie,Oe)}return L})}function u_(A){return function(L,z,ie){for(var _e=-1,Oe=Object(L),He=ie(L),Ae=He.length;Ae--;){var We=He[++_e];if(z(Oe[We],We,Oe)===!1)break}return L}}function xa(A,L){var z=A.__data__;return g_(L)?z[typeof L=="string"?"string":"hash"]:z.map}function Rc(A,L){var z=ot(A,L);return JS(z)?z:void 0}function d_(A){var L=rt.call(A,ro),z=A[ro];try{A[ro]=void 0;var ie=!0}catch{}var _e=to.call(A);return ie&&(L?A[ro]=z:delete A[ro]),_e}function f_(A){return typeof A.constructor=="function"&&!Fg(A)?kS(Yo(A)):{}}function Lg(A,L){var z=typeof A;return L=L??s,!!L&&(z=="number"||z!="symbol"&&U.test(A))&&A>-1&&A%1==0&&A<L}function h_(A,L,z){if(!io(z))return!1;var ie=typeof L;return(ie=="number"?Mc(z)&&Lg(L,z.length):ie=="string"&&L in z)?ba(z[L],A):!1}function g_(A){var L=typeof A;return L=="string"||L=="number"||L=="symbol"||L=="boolean"?A!=="__proto__":A===null}function p_(A){return!!It&&It in A}function Fg(A){var L=A&&A.constructor,z=typeof L=="function"&&L.prototype||se;return A===z}function m_(A){var L=[];if(A!=null)for(var z in Object(A))L.push(z);return L}function y_(A){return to.call(A)}function v_(A,L,z){return L=Ag(L===void 0?A.length-1:L,0),function(){for(var ie=arguments,_e=-1,Oe=Ag(ie.length-L,0),He=Array(Oe);++_e<Oe;)He[_e]=ie[L+_e];_e=-1;for(var Ae=Array(L+1);++_e<L;)Ae[_e]=ie[_e];return Ae[L]=z(He),je(A,this,Ae)}}function kc(A,L){if(!(L==="constructor"&&typeof A[L]=="function")&&L!="__proto__")return A[L]}var x_=b_(r_);function b_(A){var L=0,z=0;return function(){var ie=RS(),_e=i-(ie-z);if(z=ie,_e>0){if(++L>=o)return arguments[0]}else L=0;return A.apply(void 0,arguments)}}function w_(A){if(A!=null){try{return Ye.call(A)}catch{}try{return A+""}catch{}}return""}function ba(A,L){return A===L||A!==A&&L!==L}var Ac=Mg((function(){return arguments})())?Mg:function(A){return os(A)&&rt.call(A,"callee")&&!_S.call(A,"callee")},Nc=Array.isArray;function Mc(A){return A!=null&&Og(A.length)&&!Pc(A)}function C_(A){return os(A)&&Mc(A)}var $g=ES||R_;function Pc(A){if(!io(A))return!1;var L=va(A);return L==h||L==g||L==c||L==x}function Og(A){return typeof A=="number"&&A>-1&&A%1==0&&A<=s}function io(A){var L=typeof A;return A!=null&&(L=="object"||L=="function")}function os(A){return A!=null&&typeof A=="object"}function S_(A){if(!os(A)||va(A)!=y)return!1;var L=Yo(A);if(L===null)return!0;var z=rt.call(L,"constructor")&&L.constructor;return typeof z=="function"&&z instanceof z&&Ye.call(z)==no}var Ig=ze?gn(ze):QS;function __(A){return l_(A,Dg(A))}function Dg(A){return Mc(A)?YS(A):e_(A)}var T_=c_(function(A,L,z){Pg(A,L,z)});function E_(A){return function(){return A}}function jg(A){return A}function R_(){return!1}e.exports=T_})(bs,bs.exports)),bs.exports}var n3=t3();const r3=Lf(n3),Rb=S.createContext(null);function o3(){return S.useContext(Rb)}function i3({children:e,locale:t}){return C.jsx(Rb.Provider,{value:t||null,children:e})}function s3({localeKey:e,defaultLocale:t}){const n=S.createContext(t);function r(s){const{extraLocale:a}=s||{},l=o3();return{value:S.useMemo(()=>{const u=l?l[e]:null,f=[{},t];return u&&f.push(u),a&&f.push(a),r3(...f)},[t,a,e,l])}}function o(){return S.useContext(n)}function i({children:s,locale:a}){const{value:l}=r({extraLocale:a});return C.jsx(n.Provider,{value:l,children:s})}return{Context:n,useComposeLocaleProviderValue:r,useLocale:o,Provider:i}}const kb="MarkdownTextEditor",a3={toolbar:{link:{textPlaceholder:"Enter the text to display",linkPlaceholder:"Paste a link",linkErrorText:"Please enter a valid link",buttonText:"Save"},table:{maxRowsErrorText:e=>`Maximum number of rows is ${e.limit}`,maxColumnsErrorText:e=>`Maximum number of columns is ${e.limit}`,minRowsErrorText:e=>`Minimum number of rows is ${e.limit}`,minColumnsErrorText:e=>`Minimum number of columns is ${e.limit}`,rowsPlaceholder:"Rows count",columnsPlaceholder:"Columns count",buttonText:"Create table"},textSize:{paragraph:"Normal text",h1:"Heading 1",h2:"Heading 2",h3:"Heading 3"},preview:{show:"Preview",hide:"Preview"},actions:{bold:"Bold",italic:"Italic",underline:"Underline",strikethrough:"Strikethrough",link:"Link",image:"Image",alignLeft:"Align left",alignCenter:"Align center",alignRight:"Align right",table:"Table",bulletList:"Bullet list",numberedList:"Numbered list"}}},{Provider:l3,useLocale:na}=s3({localeKey:kb,defaultLocale:a3}),Ab=S.createContext(null);function c3(e,t){return{getTheme:function(){return t??null}}}function lt(){const e=S.useContext(Ab);return e==null&&(function(t,...n){const r=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",t);for(const i of n)o.append("v",i);throw r.search=o.toString(),Error(`Minified Lexical error #${t}; visit ${r.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)})(8),e}function Y(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const o of t)r.append("v",o);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function Nb(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const o of t)r.append("v",o);n.search=r.toString(),console.warn(`Minified Lexical warning #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const Ln=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,u3=Ln&&"documentMode"in document?document.documentMode:null,wn=Ln&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),ko=Ln&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),bl=!(!Ln||!("InputEvent"in window)||u3)&&"getTargetRanges"in new window.InputEvent("input"),ra=Ln&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),Ki=Ln&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,d3=Ln&&/Android/.test(navigator.userAgent),Mb=Ln&&/^(?=.*Chrome).*/i.test(navigator.userAgent),lm=Ln&&d3&&Mb,oa=Ln&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&wn&&!Mb;function Pb(...e){const t=[];for(const n of e)if(n&&typeof n=="string")for(const[r]of n.matchAll(/\S+/g))t.push(r);return t}const f3=0,h3=1,g3=2,Lb=128,p3=1,m3=2,y3=3,v3=4,x3=5,b3=6,Zl=ra||Ki||oa?" ":"​",zr=`
35
35
 
36
- `,v3=wo?" ":Hl,jr={bold:1,capitalize:1024,code:16,highlight:k1,italic:2,lowercase:256,strikethrough:4,subscript:32,superscript:64,underline:8,uppercase:512},x3={directionless:1,unmergeable:2},sm={center:2,end:6,justify:4,left:1,right:3,start:5},b3={[h3]:"center",[y3]:"end",[p3]:"justify",[f3]:"left",[g3]:"right",[m3]:"start"},w3={normal:0,segmented:2,token:1},C3={[c3]:"normal",[d3]:"segmented",[u3]:"token"},am="$config";function A1(e,t,n,r,o,i){let s=e.getFirstChild();for(;s!==null;){const a=s.__key;s.__parent===t&&(B(s)&&A1(s,a,n,r,o,i),n.has(a)||i.delete(a),o.push(a)),s=s.getNextSibling()}}let wd=!1,ah=0;function S3(e){ah=e.timeStamp}function Kc(e,t,n){const r=e.nodeName==="BR",o=t.__lexicalLineBreak;return o&&(e===o||r&&e.previousSibling===o)||r&&tc(e,n)!==void 0}function _3(e,t,n){const r=Lt(dn(n));let o=null,i=null;r!==null&&r.anchorNode===e&&(o=r.anchorOffset,i=r.focusOffset);const s=e.nodeValue;s!==null&&Ah(t,s,o,i,!1)}function T3(e,t,n){if(W(e)){const r=e.anchor.getNode();if(r.is(n)&&e.format!==r.getFormat())return!1}return xr(t)&&n.isAttached()}function E3(e,t,n,r){for(let o=e;o&&!MA(o);o=ea(o)){const i=tc(o,t);if(i!==void 0){const s=Le(i,n);if(s)return _e(s)||!Be(o)?void 0:[o,s]}else if(o===r)return[r,Mb(n)]}}function M1(e,t,n){wd=!0;const r=performance.now()-ah>100;try{Hn(e,()=>{const o=Y()||(function(d){return d.getEditorState().read(()=>{const h=Y();return h!==null?h.clone():null})})(e),i=new Map,s=e.getRootElement(),a=e._editorState,l=e._blockCursorElement;let c=!1,u="";for(let d=0;d<t.length;d++){const h=t[d],g=h.type,p=h.target,m=E3(p,e,a,s);if(!m)continue;const[x,y]=m;if(g==="characterData")r&&X(y)&&xr(p)&&T3(o,p,y)&&_3(p,y,e);else if(g==="childList"){c=!0;const v=h.addedNodes;for(let _=0;_<v.length;_++){const E=v[_],T=kb(E),k=E.parentNode;if(k!=null&&E!==l&&T===null&&!Kc(E,k,e)){if(wo){const P=(Be(E)?E.innerText:null)||E.nodeValue;P&&(u+=P)}k.removeChild(E)}}const b=h.removedNodes,w=b.length;if(w>0){let _=0;for(let E=0;E<w;E++){const T=b[E];(Kc(T,p,e)||l===T)&&(p.appendChild(T),_++)}w!==_&&i.set(x,y)}}}if(i.size>0)for(const[d,h]of i)h.reconcileObservedMutation(d,e);const f=n.takeRecords();if(f.length>0){for(let d=0;d<f.length;d++){const h=f[d],g=h.addedNodes,p=h.target;for(let m=0;m<g.length;m++){const x=g[m],y=x.parentNode;y==null||x.nodeName!=="BR"||Kc(x,p,e)||y.removeChild(x)}}n.takeRecords()}o!==null&&(c&&Ge(o),wo&&Fb(e)&&o.insertRawText(u))})}finally{wd=!1}}function N1(e){const t=e._observer;t!==null&&M1(e,t.takeRecords(),t)}function P1(e){(function(t){ah===0&&dn(t).addEventListener("textInput",S3,!0)})(e),e._observer=new MutationObserver((t,n)=>{M1(e,t,n)})}let R3=class{key;parse;unparse;isEqual;defaultValue;constructor(t,n){this.key=t,this.parse=n.parse.bind(n),this.unparse=(n.unparse||N3).bind(n),this.isEqual=(n.isEqual||Object.is).bind(n),this.defaultValue=this.parse(void 0)}};function k3(e,t){return new R3(e,t)}function L1(e,t,n="latest"){const r=(n==="latest"?e.getLatest():e).__state;return r?r.getValue(t):t.defaultValue}function Uc(e,t,n){let r;if(ut(),typeof n=="function"){const i=e.getLatest(),s=L1(i,t);if(r=n(s),t.isEqual(s,r))return i}else r=n;const o=e.getWritable();return $1(o).updateFromKnown(t,r),o}function A3(e){const t=new Map,n=new Set;for(let r=typeof e=="function"?e:e.replace;r.prototype&&r.prototype.getType!==void 0;r=Object.getPrototypeOf(r)){const{ownNodeConfig:o}=rc(r);if(o&&o.stateConfigs)for(const i of o.stateConfigs){let s;"stateConfig"in i?(s=i.stateConfig,i.flat&&n.add(s.key)):s=i,t.set(s.key,s)}}return{flatKeys:n,sharedConfigMap:t}}let M3=class F1{node;knownState;unknownState;sharedNodeState;size;constructor(t,n,r=void 0,o=new Map,i=void 0){this.node=t,this.sharedNodeState=n,this.unknownState=r,this.knownState=o;const{sharedConfigMap:s}=this.sharedNodeState,a=i!==void 0?i:(function(l,c,u){let f=u.size;if(c)for(const d in c){const h=l.get(d);h&&u.has(h)||f++}return f})(s,r,o);this.size=a}getValue(t){const n=this.knownState.get(t);if(n!==void 0)return n;this.sharedNodeState.sharedConfigMap.set(t.key,t);let r=t.defaultValue;if(this.unknownState&&t.key in this.unknownState){const o=this.unknownState[t.key];o!==void 0&&(r=t.parse(o)),this.updateFromKnown(t,r)}return r}getInternalState(){return[this.unknownState,this.knownState]}toJSON(){const t={...this.unknownState},n={};for(const[r,o]of this.knownState)r.isEqual(o,r.defaultValue)?delete t[r.key]:t[r.key]=r.unparse(o);for(const r of this.sharedNodeState.flatKeys)r in t&&(n[r]=t[r],delete t[r]);return lm(t)&&(n.$=t),n}getWritable(t){if(this.node===t)return this;const{sharedNodeState:n,unknownState:r}=this,o=new Map(this.knownState);return new F1(t,n,(function(i,s,a){let l;if(a)for(const[c,u]of Object.entries(a)){const f=i.get(c);f?s.has(f)||s.set(f,f.parse(u)):(l=l||{},l[c]=u)}return l})(n.sharedConfigMap,o,r),o,this.size)}updateFromKnown(t,n){const r=t.key;this.sharedNodeState.sharedConfigMap.set(r,t);const{knownState:o,unknownState:i}=this;o.has(t)||i&&r in i||(i&&(delete i[r],this.unknownState=lm(i)),this.size++),o.set(t,n)}updateFromUnknown(t,n){const r=this.sharedNodeState.sharedConfigMap.get(t);r?this.updateFromKnown(r,r.parse(n)):(this.unknownState=this.unknownState||{},t in this.unknownState||this.size++,this.unknownState[t]=n)}updateFromJSON(t){const{knownState:n}=this;for(const r of n.keys())n.set(r,r.defaultValue);if(this.size=n.size,this.unknownState=void 0,t)for(const[r,o]of Object.entries(t))this.updateFromUnknown(r,o)}};function $1(e){const t=e.getWritable(),n=t.__state?t.__state.getWritable(t):new M3(t,O1(t));return t.__state=n,n}function O1(e){return e.__state?e.__state.sharedNodeState:Cb(Hi(),e.getType()).sharedNodeState}function lm(e){if(e)for(const t in e)return e}function N3(e){return e}function cm(e,t,n){for(const[r,o]of t.knownState){if(e.has(r.key))continue;e.add(r.key);const i=n?n.getValue(r):r.defaultValue;if(i!==o&&!r.isEqual(i,o))return!0}return!1}function um(e,t,n){const{unknownState:r}=t,o=n?n.unknownState:void 0;if(r){for(const[i,s]of Object.entries(r))if(!e.has(i)&&(e.add(i),s!==(o?o[i]:void 0)))return!0}return!1}function dm(e,t){const n=e.__state;return n&&n.node===e?n.getWritable(t):n}function fm(e,t){const n=e.__mode,r=e.__format,o=e.__style,i=t.__mode,s=t.__format,a=t.__style,l=e.__state,c=t.__state;return(n===null||n===i)&&(r===null||r===s)&&(o===null||o===a)&&(e.__state===null||l===c||(function(u,f){if(u===f)return!0;if(u&&f&&u.size!==f.size)return!1;const d=new Set;return!(u&&cm(d,u,f)||f&&cm(d,f,u)||u&&um(d,u,f)||f&&um(d,f,u))})(l,c))}function hm(e,t){const n=e.mergeWithSibling(t),r=$e()._normalizedNodes;return r.add(e.__key),r.add(t.__key),n}function gm(e){let t,n,r=e;if(r.__text!==""||!r.isSimpleText()||r.isUnmergeable()){for(;(t=r.getPreviousSibling())!==null&&X(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(t.__text!==""){if(fm(t,r)){r=hm(t,r);break}break}t.remove()}for(;(n=r.getNextSibling())!==null&&X(n)&&n.isSimpleText()&&!n.isUnmergeable();){if(n.__text!==""){if(fm(r,n)){r=hm(r,n);break}break}n.remove()}}else r.remove()}function Ls(e){return pm(e.anchor),pm(e.focus),e}function pm(e){for(;e.type==="element";){const t=e.getNode(),n=e.offset;let r,o;if(n===t.getChildrenSize()?(r=t.getChildAtIndex(n-1),o=!0):(r=t.getChildAtIndex(n),o=!1),X(r)){e.set(r.__key,o?r.getTextContentSize():0,"text",!0);break}if(!B(r))break;e.set(r.__key,o?r.getChildrenSize():0,"element",!0)}}let Co,Ct,Fs,Wl,Cd,Sd,So,Sn,_d,$s,lt="",$n=null,io=null,ir="",ei=!1,hl=!1;function gl(e,t){const n=So.get(e);if(t!==null){const r=kd(e);r.parentNode===t&&t.removeChild(r)}if(Sn.has(e)||Ct._keyToDOMMap.delete(e),B(n)){const r=ml(n,So);Td(r,0,r.length-1,null)}n!==void 0&&Mh($s,Fs,Wl,n,"destroyed")}function Td(e,t,n,r){let o=t;for(;o<=n;++o){const i=e[o];i!==void 0&&gl(i,r)}}function no(e,t){e.setProperty("text-align",t)}const P3="40px";function I1(e,t){const n=Co.theme.indent;if(typeof n=="string"){const o=e.classList.contains(n);t>0&&!o?e.classList.add(n):t<1&&o&&e.classList.remove(n)}const r=getComputedStyle(e).getPropertyValue("--lexical-indent-base-value")||P3;e.style.setProperty("padding-inline-start",t===0?"":`calc(${t} * ${r})`)}function D1(e,t){const n=e.style;t===0?no(n,""):t===1?no(n,"left"):t===2?no(n,"center"):t===3?no(n,"right"):t===4?no(n,"justify"):t===5?no(n,"start"):t===6&&no(n,"end")}function Ed(e,t){const n=(function(r){const o=r.__dir;if(o!==null)return o;if(ot(r))return null;const i=r.getParentOrThrow();return ot(i)&&i.__dir===null?"auto":null})(t);n!==null?e.dir=n:e.removeAttribute("dir")}function pl(e,t){const n=Sn.get(e);n===void 0&&q(60);const r=n.createDOM(Co,Ct);if((function(o,i,s){const a=s._keyToDOMMap;(function(l,c,u){const f=`__lexicalKey_${c._key}`;l[f]=u})(i,s,o),a.set(o,i)})(e,r,Ct),X(n)?r.setAttribute("data-lexical-text","true"):_e(n)&&r.setAttribute("data-lexical-decorator","true"),B(n)){const o=n.__indent,i=n.__size;if(Ed(r,n),o!==0&&I1(r,o),i!==0){const a=i-1;Rd(ml(n,Sn),n,0,a,n.getDOMSlot(r))}const s=n.__format;s!==0&&D1(r,s),n.isInline()||j1(null,n,r),nc(n)&&(lt+=Dr,ir+=Dr)}else{const o=n.getTextContent();if(_e(n)){const i=n.decorate(Ct,Co);i!==null&&V1(e,i),r.contentEditable="false"}lt+=o,ir+=o}return t!==null&&t.insertChild(r),Mh($s,Fs,Wl,n,"created"),r}function Rd(e,t,n,r,o){const i=lt;lt="";let s=n;for(;s<=r;++s){pl(e[s],o);const a=Sn.get(e[s]);a!==null&&X(a)&&$n===null&&($n=a.getFormat(),io=a.getStyle())}nc(t)&&(lt+=Dr),o.element.__lexicalTextContent=lt,lt=i+lt}function mm(e,t){if(e){const n=e.__last;if(n){const r=t.get(n);if(r)return zn(r)?"line-break":_e(r)&&r.isInline()?"decorator":null}return"empty"}return null}function j1(e,t,n){const r=mm(e,So),o=mm(t,Sn);r!==o&&t.getDOMSlot(n).setManagedLineBreak(o)}function L3(e,t,n){var r;$n=null,io=null,(function(o,i,s){const a=lt,l=o.__size,c=i.__size;lt="";const u=s.element;if(l===1&&c===1){const f=o.__first,d=i.__first;if(f===d)hs(f,u);else{const g=kd(f),p=pl(d,null);try{u.replaceChild(p,g)}catch(m){if(typeof m=="object"&&m!=null){const x=`${m.toString()} Parent: ${u.tagName}, new child: {tag: ${p.tagName} key: ${d}}, old child: {tag: ${g.tagName}, key: ${f}}.`;throw new Error(x)}throw m}gl(f,null)}const h=Sn.get(d);X(h)&&$n===null&&($n=h.getFormat(),io=h.getStyle())}else{const f=ml(o,So),d=ml(i,Sn);if(f.length!==l&&q(227),d.length!==c&&q(228),l===0)c!==0&&Rd(d,i,0,c-1,s);else if(c===0){if(l!==0){const h=s.after==null&&s.before==null&&s.element.__lexicalLineBreak==null;Td(f,0,l-1,h?null:u),h&&(u.textContent="")}}else(function(h,g,p,m,x,y){const v=m-1,b=x-1;let w,_,E=y.getFirstChild(),T=0,k=0;for(;T<=v&&k<=b;){const D=g[T],I=p[k];if(D===I)E=Gc(hs(I,y.element)),T++,k++;else{w===void 0&&(w=new Set(g)),_===void 0&&(_=new Set(p));const H=_.has(D),U=w.has(I);if(H)if(U){const L=Eo(Ct,I);L===E?E=Gc(hs(I,y.element)):(y.withBefore(E).insertChild(L),hs(I,y.element)),T++,k++}else pl(I,y.withBefore(E)),k++;else E=Gc(kd(D)),gl(D,y.element),T++}const $=Sn.get(I);$!==null&&X($)&&$n===null&&($n=$.getFormat(),io=$.getStyle())}const P=T>v,O=k>b;if(P&&!O){const D=p[b+1],I=D===void 0?null:Ct.getElementByKey(D);Rd(p,h,k,b,y.withBefore(I))}else O&&!P&&Td(g,T,v,y.element)})(i,f,d,l,c,s)}nc(i)&&(lt+=Dr),u.__lexicalTextContent=lt,lt=a+lt})(e,t,t.getDOMSlot(n)),r=t,$n==null||$n===r.__textFormat||hl||r.setTextFormat($n),(function(o){io==null||io===o.__textStyle||hl||o.setTextStyle(io)})(t)}function ml(e,t){const n=[];let r=e.__first;for(;r!==null;){const o=t.get(r);o===void 0&&q(101),n.push(r),r=o.__next}return n}function hs(e,t){const n=So.get(e);let r=Sn.get(e);n!==void 0&&r!==void 0||q(61);const o=ei||Sd.has(e)||Cd.has(e),i=Eo(Ct,e);if(n===r&&!o){if(B(n)){const s=i.__lexicalTextContent;s!==void 0&&(lt+=s,ir+=s)}else{const s=n.getTextContent();ir+=s,lt+=s}return i}if(n!==r&&o&&Mh($s,Fs,Wl,r,"updated"),r.updateDOM(n,i,Co)){const s=pl(e,null);return t===null&&q(62),t.replaceChild(s,i),gl(e,null),s}if(B(n)&&B(r)){const s=r.__indent;(ei||s!==n.__indent)&&I1(i,s);const a=r.__format;if((ei||a!==n.__format)&&D1(i,a),o&&(L3(n,r,i),ot(r)||r.isInline()||j1(n,r,i)),nc(r)&&(lt+=Dr,ir+=Dr),(ei||r.__dir!==n.__dir)&&(Ed(i,r),ot(r)&&!ei))for(const l of r.getChildren())B(l)&&Ed(Eo(Ct,l.getKey()),l)}else{const s=r.getTextContent();if(_e(r)){const a=r.decorate(Ct,Co);a!==null&&V1(e,a)}lt+=s,ir+=s}if(!hl&&ot(r)&&r.__cachedText!==ir){const s=r.getWritable();s.__cachedText=ir,r=s}return i}function V1(e,t){let n=Ct._pendingDecorators;const r=Ct._decorators;if(n===null){if(r[e]===t)return;n=Ab(Ct)}n[e]=t}function Gc(e){let t=e.nextSibling;return t!==null&&t===Ct._blockCursorElement&&(t=t.nextSibling),t}function F3(e,t,n,r,o,i){lt="",ir="",ei=r===2,Ct=n,Co=n._config,Fs=n._nodes,Wl=Ct._listeners.mutation,Cd=o,Sd=i,So=e._nodeMap,Sn=t._nodeMap,hl=t._readOnly,_d=new Map(n._keyToDOMMap);const s=new Map;return $s=s,hs("root",null),Ct=void 0,Fs=void 0,Cd=void 0,Sd=void 0,So=void 0,Sn=void 0,Co=void 0,_d=void 0,$s=void 0,s}function kd(e){const t=_d.get(e);return t===void 0&&q(75,e),t}function le(e){return{type:e}}const cr=le("SELECTION_CHANGE_COMMAND"),lh=le("SELECTION_INSERT_CLIPBOARD_NODES_COMMAND"),Kl=le("CLICK_COMMAND"),B1=le("BEFORE_INPUT_COMMAND"),z1=le("INPUT_COMMAND"),H1=le("COMPOSITION_START_COMMAND"),W1=le("COMPOSITION_END_COMMAND"),Fr=le("DELETE_CHARACTER_COMMAND"),gi=le("INSERT_LINE_BREAK_COMMAND"),_o=le("INSERT_PARAGRAPH_COMMAND"),vo=le("CONTROLLED_TEXT_INSERTION_COMMAND"),ch=le("PASTE_COMMAND"),Ad=le("REMOVE_TEXT_COMMAND"),Ri=le("DELETE_WORD_COMMAND"),To=le("DELETE_LINE_COMMAND"),It=le("FORMAT_TEXT_COMMAND"),K1=le("UNDO_COMMAND"),U1=le("REDO_COMMAND"),G1=le("KEYDOWN_COMMAND"),uh=le("KEY_ARROW_RIGHT_COMMAND"),$3=le("MOVE_TO_END"),dh=le("KEY_ARROW_LEFT_COMMAND"),O3=le("MOVE_TO_START"),fh=le("KEY_ARROW_UP_COMMAND"),hh=le("KEY_ARROW_DOWN_COMMAND"),yl=le("KEY_ENTER_COMMAND"),q1=le("KEY_SPACE_COMMAND"),Ul=le("KEY_BACKSPACE_COMMAND"),gh=le("KEY_ESCAPE_COMMAND"),ph=le("KEY_DELETE_COMMAND"),mh=le("KEY_TAB_COMMAND"),I3=le("INSERT_TAB_COMMAND"),D3=le("INDENT_CONTENT_COMMAND"),ym=le("OUTDENT_CONTENT_COMMAND"),Y1=le("DROP_COMMAND"),pi=le("FORMAT_ELEMENT_COMMAND"),X1=le("DRAGSTART_COMMAND"),Z1=le("DRAGOVER_COMMAND"),j3=le("DRAGEND_COMMAND"),Gl=le("COPY_COMMAND"),ql=le("CUT_COMMAND"),Md=le("SELECT_ALL_COMMAND"),J1=le("FOCUS_COMMAND"),V3=le("BLUR_COMMAND"),B3=le("KEY_MODIFIER_COMMAND"),Jn=Object.freeze({}),Nd=[["keydown",function(e,t){Os=e.timeStamp,Q1=e.key,!t.isComposing()&&Q(t,G1,e)}],["pointerdown",function(e,t){const n=e.target,r=e.pointerType;xn(n)&&r!=="touch"&&r!=="pen"&&e.button===0&&Hn(t,()=>{Sb(n)||(Fd=!0)})}],["compositionstart",function(e,t){Q(t,H1,e)}],["compositionend",function(e,t){wo?gs=!0:Ii||!Ys&&!Xs?Q(t,W1,e):($d=!0,Od=e.data)}],["input",function(e,t){e.stopPropagation(),Hn(t,()=>{t.dispatchCommand(z1,e)},{event:e}),ti=null}],["click",function(e,t){Hn(t,()=>{const n=Y(),r=Lt(dn(t)),o=qn();if(r){if(W(n)){const i=n.anchor,s=i.getNode();if(i.type==="element"&&i.offset===0&&n.isCollapsed()&&!ot(s)&&qe().getChildrenSize()===1&&s.getTopLevelElementOrThrow().isEmpty()&&o!==null&&n.is(o))r.removeAllRanges(),n.dirty=!0;else if(e.detail===3&&!n.isCollapsed()&&s!==n.focus.getNode()){const a=we(s,l=>B(l)&&!l.isInline());B(a)&&a.select(0)}}else if(e.pointerType==="touch"||e.pointerType==="pen"){const i=r.anchorNode;(Be(i)||xr(i))&&Ge(Jl(o,r,t,e))}}Q(t,Kl,e)})}],["cut",Jn],["copy",Jn],["dragstart",Jn],["dragover",Jn],["dragend",Jn],["paste",Jn],["focus",Jn],["blur",Jn],["drop",Jn]];fl&&Nd.push(["beforeinput",(e,t)=>(function(n,r){const o=n.inputType;o==="deleteCompositionText"||wo&&Fb(r)||o!=="insertCompositionText"&&Q(r,B1,n)})(e,t)]);let Os=0,Q1=null,eb=0,ti=null;const Pd=new WeakMap,vl=new WeakMap;let Ld=!1,Fd=!1,bs=!1,gs=!1,$d=!1,Od="",co=null,tb=[0,"",0,"root",0];function nb(e,t,n,r,o){const i=e.anchor,s=e.focus,a=i.getNode(),l=$e(),c=Lt(dn(l)),u=c!==null?c.anchorNode:null,f=i.key,d=l.getElementByKey(f),h=n.length;return f!==s.key||!X(a)||(!o&&(!fl||eb<r+50)||a.isDirty()&&h<2||Nb(n))&&i.offset!==s.offset&&!a.isComposing()||rr(a)||a.isDirty()&&h>1||(o||!fl)&&d!==null&&!a.isComposing()&&u!==Ai(d)||c!==null&&t!==null&&(!t.collapsed||t.startContainer!==c.anchorNode||t.startOffset!==c.anchorOffset)||a.getFormat()!==e.format||a.getStyle()!==e.style||(function(g,p){if(p.isSegmented())return!0;if(!g.isCollapsed())return!1;const m=g.anchor.offset,x=p.getParentOrThrow(),y=xo(p);return m===0?!p.canInsertTextBefore()||!x.canInsertTextBefore()&&!p.isComposing()||y||(function(v){const b=v.getPreviousSibling();return(X(b)||B(b)&&b.isInline())&&!b.canInsertTextAfter()})(p):m===p.getTextContentSize()&&(!p.canInsertTextAfter()||!x.canInsertTextAfter()&&!p.isComposing()||y)})(e,a)}function vm(e,t){return xr(e)&&e.nodeValue!==null&&t!==0&&t!==e.nodeValue.length}function xm(e,t,n){const{anchorNode:r,anchorOffset:o,focusNode:i,focusOffset:s}=e;Ld&&(Ld=!1,vm(r,o)&&vm(i,s)&&!co)||Hn(t,()=>{if(!n)return void Ge(null);if(!Qs(t,r,i))return;let a=Y();if(co&&W(a)&&a.isCollapsed()){const l=a.anchor,c=co.anchor;(l.key===c.key&&l.offset===c.offset+1||l.offset===1&&c.getNode().is(l.getNode().getPreviousSibling()))&&(a=co.clone(),Ge(a))}if(co=null,W(a)){const l=a.anchor,c=l.getNode();if(a.isCollapsed()){e.type==="Range"&&e.anchorNode===e.focusNode&&(a.dirty=!0);const u=dn(t).event,f=u?u.timeStamp:performance.now(),[d,h,g,p,m]=tb,x=qe(),y=t.isComposing()===!1&&x.getTextContent()==="";if(f<m+200&&l.offset===g&&l.key===p)Ya(a,d,h);else if(l.type==="text")X(c)||q(141),rb(a,c);else if(l.type==="element"&&!y){B(c)||q(259);const v=l.getNode();v.isEmpty()?(function(b,w){const _=w.getTextFormat(),E=w.getTextStyle();Ya(b,_,E)})(a,v):Ya(a,0,"")}}else{const u=l.key,f=a.focus.key,d=a.getNodes(),h=d.length,g=a.isBackward(),p=g?s:o,m=g?o:s,x=g?f:u,y=g?u:f;let v=2047,b=!1;for(let w=0;w<h;w++){const _=d[w],E=_.getTextContentSize();if(X(_)&&E!==0&&!(w===0&&_.__key===x&&p===E||w===h-1&&_.__key===y&&m===0)&&(b=!0,v&=_.getFormat(),v===0))break}a.format=b?v:0}}Q(t,cr,void 0)})}function Ya(e,t,n){e.format===t&&e.style===n||(e.format=t,e.style=n,e.dirty=!0)}function rb(e,t){Ya(e,t.getFormat(),t.getStyle())}function ob(e){if(!e.getTargetRanges)return null;const t=e.getTargetRanges();return t.length===0?null:t[0]}function z3(e){const t=e.inputType,n=ob(e),r=$e(),o=Y();if(t==="deleteContentBackward"){if(o===null){const f=qn();if(!W(f))return!0;Ge(f.clone())}if(W(o)){const f=o.anchor.key===o.focus.key;if(i=e.timeStamp,Q1==="MediaLast"&&i<Os+30&&r.isComposing()&&f){if(gt(null),Os=0,setTimeout(()=>{Hn(r,()=>{gt(null)})},30),W(o)){const d=o.anchor.getNode();d.markDirty(),X(d)||q(142),rb(o,d)}}else{gt(null),e.preventDefault();const d=o.anchor.getNode(),h=d.getTextContent(),g=d.canInsertTextAfter(),p=o.anchor.offset===0&&o.focus.offset===h.length;let m=im&&f&&!p&&g;if(m&&o.isCollapsed()&&(m=!_e(Bd(o.anchor,!0))),!m){Q(r,Fr,!0);const x=Y();im&&W(x)&&x.isCollapsed()&&(co=x,setTimeout(()=>co=null))}}return!0}}var i;if(!W(o))return!0;const s=e.data;ti!==null&&kh(!1,r,ti),o.dirty&&ti===null||!o.isCollapsed()||ot(o.anchor.getNode())||n===null||o.applyDOMRange(n),ti=null;const a=o.anchor,l=o.focus,c=a.getNode(),u=l.getNode();if(t==="insertText"||t==="insertTranspose"){if(s===`
37
- `)e.preventDefault(),Q(r,gi,!1);else if(s===Dr)e.preventDefault(),Q(r,_o,void 0);else if(s==null&&e.dataTransfer){const f=e.dataTransfer.getData("text/plain");e.preventDefault(),o.insertRawText(f)}else s!=null&&nb(o,n,s,e.timeStamp,!0)?(e.preventDefault(),Q(r,vo,s)):ti=s;return eb=e.timeStamp,!0}switch(e.preventDefault(),t){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":Q(r,vo,e);break;case"insertFromComposition":gt(null),Q(r,vo,e);break;case"insertLineBreak":gt(null),Q(r,gi,!1);break;case"insertParagraph":gt(null),bs&&!Ii?(bs=!1,Q(r,gi,!1)):Q(r,_o,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":Q(r,ch,e);break;case"deleteByComposition":(function(f,d){return f!==d||B(f)||B(d)||!xo(f)||!xo(d)})(c,u)&&Q(r,Ad,e);break;case"deleteByDrag":case"deleteByCut":Q(r,Ad,e);break;case"deleteContent":Q(r,Fr,!1);break;case"deleteWordBackward":Q(r,Ri,!0);break;case"deleteWordForward":Q(r,Ri,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":Q(r,To,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":Q(r,To,!1);break;case"formatStrikeThrough":Q(r,It,"strikethrough");break;case"formatBold":Q(r,It,"bold");break;case"formatItalic":Q(r,It,"italic");break;case"formatUnderline":Q(r,It,"underline");break;case"historyUndo":Q(r,K1,void 0);break;case"historyRedo":Q(r,U1,void 0)}return!0}function H3(e){if(Be(e.target)&&Sb(e.target))return!0;const t=$e(),n=Y(),r=e.data,o=ob(e);if(r!=null&&W(n)&&nb(n,o,r,e.timeStamp,!1)){gs&&(xl(t,r),gs=!1);const i=n.anchor.getNode(),s=Lt(dn(t));if(s===null)return!0;const a=n.isBackward(),l=a?n.anchor.offset:n.focus.offset,c=a?n.focus.offset:n.anchor.offset;fl&&!n.isCollapsed()&&X(i)&&s.anchorNode!==null&&i.getTextContent().slice(0,l)+r+i.getTextContent().slice(l+c)===Lb(s.anchorNode)||Q(t,vo,r);const u=r.length;wo&&u>1&&e.inputType==="insertCompositionText"&&!t.isComposing()&&(n.anchor.offset-=u),Ys||Ii||Xs||!t.isComposing()||(Os=0,gt(null))}else kh(!1,t,r!==null?r:void 0),gs&&(xl(t,r||void 0),gs=!1);return(function(){ut();const i=$e();N1(i)})(),!0}function W3(e){const t=$e(),n=Y();if(W(n)&&!t.isComposing()){const r=n.anchor,o=n.anchor.getNode();gt(r.key),(e.timeStamp<Os+30||r.type==="element"||!n.isCollapsed()||o.getFormat()!==n.format||X(o)&&o.getStyle()!==n.style)&&Q(t,vo,v3)}return!0}function K3(e){return xl($e(),e.data),!0}function xl(e,t){const n=e._compositionKey;if(gt(null),n!==null&&t!=null){if(t===""){const r=Le(n),o=Ai(e.getElementByKey(n));return void(o!==null&&o.nodeValue!==null&&X(r)&&Ah(r,o.nodeValue,null,null,!0))}if(t[t.length-1]===`
38
- `){const r=Y();if(W(r)){const o=r.focus;return r.anchor.set(o.key,o.offset,o.type),void Q(e,yl,null)}}}kh(!0,e,t)}function U3(e){const t=$e();if(e.key==null)return!0;if($d&&Wm(e))return Hn(t,()=>{xl(t,Od)}),$d=!1,Od="",!0;if((function(n){return Pe(n,"ArrowRight",{shiftKey:"any"})})(e))Q(t,uh,e);else if((function(n){return Pe(n,"ArrowRight",er)})(e))Q(t,$3,e);else if((function(n){return Pe(n,"ArrowLeft",{shiftKey:"any"})})(e))Q(t,dh,e);else if((function(n){return Pe(n,"ArrowLeft",er)})(e))Q(t,O3,e);else if((function(n){return Pe(n,"ArrowUp",{altKey:"any",shiftKey:"any"})})(e))Q(t,fh,e);else if((function(n){return Pe(n,"ArrowDown",{altKey:"any",shiftKey:"any"})})(e))Q(t,hh,e);else if((function(n){return Pe(n,"Enter",{altKey:"any",ctrlKey:"any",metaKey:"any",shiftKey:!0})})(e))bs=!0,Q(t,yl,e);else if((function(n){return n.key===" "})(e))Q(t,q1,e);else if((function(n){return vn&&Pe(n,"o",{ctrlKey:!0})})(e))e.preventDefault(),bs=!0,Q(t,gi,!0);else if((function(n){return Pe(n,"Enter",{altKey:"any",ctrlKey:"any",metaKey:"any"})})(e))bs=!1,Q(t,yl,e);else if((function(n){return Pe(n,"Backspace",{shiftKey:"any"})||vn&&Pe(n,"h",{ctrlKey:!0})})(e))Wm(e)?Q(t,Ul,e):(e.preventDefault(),Q(t,Fr,!0));else if((function(n){return n.key==="Escape"})(e))Q(t,gh,e);else if((function(n){return Pe(n,"Delete",{})||vn&&Pe(n,"d",{ctrlKey:!0})})(e))(function(n){return n.key==="Delete"})(e)?Q(t,ph,e):(e.preventDefault(),Q(t,Fr,!1));else if((function(n){return Pe(n,"Backspace",Hm)})(e))e.preventDefault(),Q(t,Ri,!0);else if((function(n){return Pe(n,"Delete",Hm)})(e))e.preventDefault(),Q(t,Ri,!1);else if((function(n){return vn&&Pe(n,"Backspace",{metaKey:!0})})(e))e.preventDefault(),Q(t,To,!0);else if((function(n){return vn&&(Pe(n,"Delete",{metaKey:!0})||Pe(n,"k",{ctrlKey:!0}))})(e))e.preventDefault(),Q(t,To,!1);else if((function(n){return Pe(n,"b",er)})(e))e.preventDefault(),Q(t,It,"bold");else if((function(n){return Pe(n,"u",er)})(e))e.preventDefault(),Q(t,It,"underline");else if((function(n){return Pe(n,"i",er)})(e))e.preventDefault(),Q(t,It,"italic");else if((function(n){return Pe(n,"Tab",{shiftKey:"any"})})(e))Q(t,mh,e);else if((function(n){return Pe(n,"z",er)})(e))e.preventDefault(),Q(t,K1,void 0);else if((function(n){return vn?Pe(n,"z",{metaKey:!0,shiftKey:!0}):Pe(n,"y",{ctrlKey:!0})||Pe(n,"z",{ctrlKey:!0,shiftKey:!0})})(e))e.preventDefault(),Q(t,U1,void 0);else{const n=t._editorState._selection;n===null||W(n)?Km(e)&&(e.preventDefault(),Q(t,Md,e)):(function(r){return Pe(r,"c",er)})(e)?(e.preventDefault(),Q(t,Gl,e)):(function(r){return Pe(r,"x",er)})(e)?(e.preventDefault(),Q(t,ql,e)):Km(e)&&(e.preventDefault(),Q(t,Md,e))}return(function(n){return n.ctrlKey||n.shiftKey||n.altKey||n.metaKey})(e)&&t.dispatchCommand(B3,e),!0}function ib(e){let t=e.__lexicalEventHandles;return t===void 0&&(t=[],e.__lexicalEventHandles=t),t}const mi=new Map;function sb(e){const t=EA(e.target);if(t===null)return;const n=_b(t.anchorNode);if(n===null)return;Fd&&(Fd=!1,Hn(n,()=>{const l=qn(),c=t.anchorNode;(Be(c)||xr(c))&&Ge(Jl(l,t,n,e))}));const r=Rh(n),o=r[r.length-1],i=o._key,s=mi.get(i),a=s||o;a!==n&&xm(t,a,!1),xm(t,n,!0),n!==o?mi.set(i,n):s&&mi.delete(i)}function bm(e){e._lexicalHandled=!0}function wm(e){return e._lexicalHandled===!0}function G3(e){const t=Pd.get(e);if(t===void 0)return;const n=vl.get(t);if(n===void 0)return;const r=n-1;r>=0||q(164),Pd.delete(e),vl.set(t,r),r===0&&t.removeEventListener("selectionchange",sb);const o=ec(e);Eh(o)?((function(s){if(s._parentEditor!==null){const a=Rh(s),l=a[a.length-1]._key;mi.get(l)===s&&mi.delete(l)}else mi.delete(s._key)})(o),e.__lexicalEditor=null):o&&q(198);const i=ib(e);for(let s=0;s<i.length;s++)i[s]();e.__lexicalEventHandles=[]}function Id(e,t,n){ut();const r=e.__key,o=e.getParent();if(o===null)return;const i=(function(a){const l=Y();if(!W(l)||!B(a))return l;const{anchor:c,focus:u}=l,f=c.getNode(),d=u.getNode();return zd(f,a)&&c.set(a.__key,0,"element"),zd(d,a)&&u.set(a.__key,0,"element"),l})(e);let s=!1;if(W(i)&&t){const a=i.anchor,l=i.focus;a.key===r&&(Cl(a,e,o,e.getPreviousSibling(),e.getNextSibling()),s=!0),l.key===r&&(Cl(l,e,o,e.getPreviousSibling(),e.getNextSibling()),s=!0)}else bt(i)&&t&&e.isSelected()&&e.selectPrevious();if(W(i)&&t&&!s){const a=e.getIndexWithinParent();bo(e),wl(i,o,a,-1)}else bo(e);n||pt(o)||o.canBeEmpty()||!o.isEmpty()||Id(o,t),t&&i&&ot(o)&&o.isEmpty()&&o.selectEnd()}const ab=Symbol.for("ephemeral");function bl(e){return e[ab]||!1}class Bn{__type;__key;__parent;__prev;__next;__state;static getType(){const{ownNodeType:t}=rc(this);return t===void 0&&q(64,this.name),t}static clone(t){q(65,this.name)}$config(){return{}}config(t,n){const r=n.extends||Object.getPrototypeOf(this.constructor);return Object.assign(n,{extends:r,type:t}),{[t]:n}}afterCloneFrom(t){this.__key===t.__key?(this.__parent=t.__parent,this.__next=t.__next,this.__prev=t.__prev,this.__state=t.__state):t.__state&&(this.__state=t.__state.getWritable(this))}static importDOM;constructor(t){this.__type=this.constructor.getType(),this.__parent=null,this.__prev=null,this.__next=null,Object.defineProperty(this,"__state",{configurable:!0,enumerable:!1,value:void 0,writable:!0}),Rb(this,t)}getType(){return this.__type}isInline(){q(137,this.constructor.name)}isAttached(){let t=this.__key;for(;t!==null;){if(t==="root")return!0;const n=Le(t);if(n===null)break;t=n.__parent}return!1}isSelected(t){const n=t||Y();if(n==null)return!1;const r=n.getNodes().some(o=>o.__key===this.__key);if(X(this))return r;if(W(n)&&n.anchor.type==="element"&&n.focus.type==="element"){if(n.isCollapsed())return!1;const o=this.getParent();if(_e(this)&&this.isInline()&&o){const i=n.isBackward()?n.focus:n.anchor;if(o.is(i.getNode())&&i.offset===o.getChildrenSize()&&this.is(o.getLastChild()))return!1}}return r}getKey(){return this.__key}getIndexWithinParent(){const t=this.getParent();if(t===null)return-1;let n=t.getFirstChild(),r=0;for(;n!==null;){if(this.is(n))return r;r++,n=n.getNextSibling()}return-1}getParent(){const t=this.getLatest().__parent;return t===null?null:Le(t)}getParentOrThrow(){const t=this.getParent();return t===null&&q(66,this.__key),t}getTopLevelElement(){let t=this;for(;t!==null;){const n=t.getParent();if(pt(n))return B(t)||t===this&&_e(t)||q(194),t;t=n}return null}getTopLevelElementOrThrow(){const t=this.getTopLevelElement();return t===null&&q(67,this.__key),t}getParents(){const t=[];let n=this.getParent();for(;n!==null;)t.push(n),n=n.getParent();return t}getParentKeys(){const t=[];let n=this.getParent();for(;n!==null;)t.push(n.__key),n=n.getParent();return t}getPreviousSibling(){const t=this.getLatest().__prev;return t===null?null:Le(t)}getPreviousSiblings(){const t=[],n=this.getParent();if(n===null)return t;let r=n.getFirstChild();for(;r!==null&&!r.is(this);)t.push(r),r=r.getNextSibling();return t}getNextSibling(){const t=this.getLatest().__next;return t===null?null:Le(t)}getNextSiblings(){const t=[];let n=this.getNextSibling();for(;n!==null;)t.push(n),n=n.getNextSibling();return t}getCommonAncestor(t){const n=B(this)?this:this.getParent(),r=B(t)?t:t.getParent(),o=n&&r?Za(n,r):null;return o?o.commonAncestor:null}is(t){return t!=null&&this.__key===t.__key}isBefore(t){const n=Za(this,t);return n!==null&&(n.type==="descendant"||(n.type==="branch"?Bb(n)===-1:(n.type!=="same"&&n.type!=="ancestor"&&q(279),!1)))}isParentOf(t){const n=Za(this,t);return n!==null&&n.type==="ancestor"}getNodesBetween(t){const n=this.isBefore(t),r=[],o=new Set;let i=this;for(;i!==null;){const s=i.__key;if(o.has(s)||(o.add(s),r.push(i)),i===t)break;const a=B(i)?n?i.getFirstChild():i.getLastChild():null;if(a!==null){i=a;continue}const l=n?i.getNextSibling():i.getPreviousSibling();if(l!==null){i=l;continue}const c=i.getParentOrThrow();if(o.has(c.__key)||r.push(c),c===t)break;let u=null,f=c;do{if(f===null&&q(68),u=n?f.getNextSibling():f.getPreviousSibling(),f=f.getParent(),f===null)break;u!==null||o.has(f.__key)||r.push(f)}while(u===null);i=u}return n||r.reverse(),r}isDirty(){const t=$e()._dirtyLeaves;return t!==null&&t.has(this.__key)}getLatest(){if(bl(this))return this;const t=Le(this.__key);return t===null&&q(113),t}getWritable(){if(bl(this))return this;ut();const t=qr(),n=$e(),r=t._nodeMap,o=this.__key,i=this.getLatest(),s=n._cloneNotNeeded,a=Y();if(a!==null&&a.setCachedNodes(null),s.has(o))return _l(i),i;const l=Ib(i);return s.add(o),_l(l),r.set(o,l),l}getTextContent(){return""}getTextContentSize(){return this.getTextContent().length}createDOM(t,n){q(70)}updateDOM(t,n,r){q(71)}exportDOM(t){return{element:this.createDOM(t._config,t)}}exportJSON(){const t=this.__state?this.__state.toJSON():void 0;return{type:this.__type,version:1,...t}}static importJSON(t){q(18,this.name)}updateFromJSON(t){return(function(n,r){const o=n.getWritable(),i=r.$;let s=i;for(const a of O1(o).flatKeys)a in r&&(s!==void 0&&s!==i||(s={...i}),s[a]=r[a]);return(o.__state||s)&&$1(n).updateFromJSON(s),o})(this,t)}static transform(){return null}remove(t){Id(this,!0,t)}replace(t,n){ut();let r=Y();r!==null&&(r=r.clone()),Qc(this,t);const o=this.getLatest(),i=this.__key,s=t.__key,a=t.getWritable(),l=this.getParentOrThrow().getWritable(),c=l.__size;bo(a);const u=o.getPreviousSibling(),f=o.getNextSibling(),d=o.__prev,h=o.__next,g=o.__parent;if(Id(o,!1,!0),u===null?l.__first=s:u.getWritable().__next=s,a.__prev=d,f===null?l.__last=s:f.getWritable().__prev=s,a.__next=h,a.__parent=g,l.__size=c,n&&(B(this)&&B(a)||q(139),this.getChildren().forEach(p=>{a.append(p)})),W(r)){Ge(r);const p=r.anchor,m=r.focus;p.key===i&&Tm(p,a),m.key===i&&Tm(m,a)}return kr()===i&&gt(s),a}insertAfter(t,n=!0){ut(),Qc(this,t);const r=this.getWritable(),o=t.getWritable(),i=o.getParent(),s=Y();let a=!1,l=!1;if(i!==null){const h=t.getIndexWithinParent();if(bo(o),W(s)){const g=i.__key,p=s.anchor,m=s.focus;a=p.type==="element"&&p.key===g&&p.offset===h+1,l=m.type==="element"&&m.key===g&&m.offset===h+1}}const c=this.getNextSibling(),u=this.getParentOrThrow().getWritable(),f=o.__key,d=r.__next;if(c===null?u.__last=f:c.getWritable().__prev=f,u.__size++,r.__next=f,o.__next=d,o.__prev=r.__key,o.__parent=r.__parent,n&&W(s)){const h=this.getIndexWithinParent();wl(s,u,h+1);const g=u.__key;a&&s.anchor.set(g,h+2,"element"),l&&s.focus.set(g,h+2,"element")}return t}insertBefore(t,n=!0){ut(),Qc(this,t);const r=this.getWritable(),o=t.getWritable(),i=o.__key;bo(o);const s=this.getPreviousSibling(),a=this.getParentOrThrow().getWritable(),l=r.__prev,c=this.getIndexWithinParent();s===null?a.__first=i:s.getWritable().__next=i,a.__size++,r.__prev=i,o.__prev=l,o.__next=r.__key,o.__parent=r.__parent;const u=Y();return n&&W(u)&&wl(u,this.getParentOrThrow(),c),t}isParentRequired(){return!1}createParentElementNode(){return ye()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(t,n){ut();const r=this.getPreviousSibling(),o=this.getParentOrThrow();if(r===null)return o.select(0,0);if(B(r))return r.select();if(!X(r)){const i=r.getIndexWithinParent()+1;return o.select(i,i)}return r.select(t,n)}selectNext(t,n){ut();const r=this.getNextSibling(),o=this.getParentOrThrow();if(r===null)return o.select();if(B(r))return r.select(0,0);if(!X(r)){const i=r.getIndexWithinParent();return o.select(i,i)}return r.select(t,n)}markDirty(){this.getWritable()}reconcileObservedMutation(t,n){this.markDirty()}}const q3="historic",yi="history-merge",Y3="paste",lb="collaboration",X3="skip-scroll-into-view",Z3="skip-dom-selection",J3="skip-selection-focus";class Di extends Bn{static getType(){return"linebreak"}static clone(t){return new Di(t.__key)}constructor(t){super(t)}getTextContent(){return`
39
- `}createDOM(){return document.createElement("br")}updateDOM(){return!1}isInline(){return!0}static importDOM(){return{br:t=>(function(n){const r=n.parentElement;if(r!==null&&Tl(r)){const o=r.firstChild;if(o===n||o.nextSibling===n&&Ca(o)){const i=r.lastChild;if(i===n||i.previousSibling===n&&Ca(i))return!0}}return!1})(t)||(function(n){const r=n.parentElement;if(r!==null&&Tl(r)){const o=r.firstChild;if(o===n||o.nextSibling===n&&Ca(o))return!1;const i=r.lastChild;if(i===n||i.previousSibling===n&&Ca(i))return!0}return!1})(t)?null:{conversion:Q3,priority:0}}}static importJSON(t){return Tn().updateFromJSON(t)}}function Q3(e){return{node:Tn()}}function Tn(){return _t(new Di)}function zn(e){return e instanceof Di}function Ca(e){return xr(e)&&/^( |\t|\r?\n)+$/.test(e.textContent||"")}function qc(e,t){return 16&t?"code":t&k1?"mark":32&t?"sub":64&t?"sup":null}function Yc(e,t){return 1&t?"strong":2&t?"em":"span"}function cb(e,t,n,r,o){const i=r.classList;let s=vi(o,"base");s!==void 0&&i.add(...s),s=vi(o,"underlineStrikethrough");let a=!1;const l=8&t&&4&t;s!==void 0&&(8&n&&4&n?(a=!0,l||i.add(...s)):l&&i.remove(...s));for(const c in jr){const u=jr[c];if(s=vi(o,c),s!==void 0)if(n&u){if(a&&(c==="underline"||c==="strikethrough")){t&u&&i.remove(...s);continue}((t&u)===0||l&&c==="underline"||c==="strikethrough")&&i.add(...s)}else t&u&&i.remove(...s)}}function ub(e,t,n){const r=t.firstChild,o=n.isComposing(),i=e+(o?Hl:"");if(r==null)t.textContent=i;else{const s=r.nodeValue;if(s!==i)if(o||wo){const[a,l,c]=(function(u,f){const d=u.length,h=f.length;let g=0,p=0;for(;g<d&&g<h&&u[g]===f[g];)g++;for(;p+g<d&&p+g<h&&u[d-p-1]===f[h-p-1];)p++;return[g,d-g-p,f.slice(g,h-p)]})(s,i);l!==0&&r.deleteData(a,l),r.insertData(a,c)}else r.nodeValue=i}}function Cm(e,t,n,r,o,i){ub(o,e,t);const s=i.theme.text;s!==void 0&&cb(0,0,r,e,s)}function Sa(e,t){const n=document.createElement(t);return n.appendChild(e),n}class un extends Bn{__text;__format;__style;__mode;__detail;static getType(){return"text"}static clone(t){return new un(t.__text,t.__key)}afterCloneFrom(t){super.afterCloneFrom(t),this.__text=t.__text,this.__format=t.__format,this.__style=t.__style,this.__mode=t.__mode,this.__detail=t.__detail}constructor(t="",n){super(n),this.__text=t,this.__format=0,this.__style="",this.__mode=0,this.__detail=0}getFormat(){return this.getLatest().__format}getDetail(){return this.getLatest().__detail}getMode(){const t=this.getLatest();return C3[t.__mode]}getStyle(){return this.getLatest().__style}isToken(){return this.getLatest().__mode===1}isComposing(){return this.__key===kr()}isSegmented(){return this.getLatest().__mode===2}isDirectionless(){return!!(1&this.getLatest().__detail)}isUnmergeable(){return!!(2&this.getLatest().__detail)}hasFormat(t){const n=jr[t];return(this.getFormat()&n)!==0}isSimpleText(){return this.__type==="text"&&this.__mode===0}getTextContent(){return this.getLatest().__text}getFormatFlags(t,n){return Sl(this.getLatest().__format,t,n)}canHaveFormat(){return!0}isInline(){return!0}createDOM(t,n){const r=this.__format,o=qc(0,r),i=Yc(0,r),s=o===null?i:o,a=document.createElement(s);let l=a;this.hasFormat("code")&&a.setAttribute("spellcheck","false"),o!==null&&(l=document.createElement(i),a.appendChild(l)),Cm(l,this,0,r,this.__text,t);const c=this.__style;return c!==""&&(a.style.cssText=c),a}updateDOM(t,n,r){const o=this.__text,i=t.__format,s=this.__format,a=qc(0,i),l=qc(0,s),c=Yc(0,i),u=Yc(0,s);if((a===null?c:a)!==(l===null?u:l))return!0;if(a===l&&c!==u){const p=n.firstChild;p==null&&q(48);const m=document.createElement(u);return Cm(m,this,0,s,o,r),n.replaceChild(m,p),!1}let f=n;l!==null&&a!==null&&(f=n.firstChild,f==null&&q(49)),ub(o,f,this);const d=r.theme.text;d!==void 0&&i!==s&&cb(0,i,s,f,d);const h=t.__style,g=this.__style;return h!==g&&(n.style.cssText=g),!1}static importDOM(){return{"#text":()=>({conversion:rA,priority:0}),b:()=>({conversion:tA,priority:0}),code:()=>({conversion:Qn,priority:0}),em:()=>({conversion:Qn,priority:0}),i:()=>({conversion:Qn,priority:0}),mark:()=>({conversion:Qn,priority:0}),s:()=>({conversion:Qn,priority:0}),span:()=>({conversion:eA,priority:0}),strong:()=>({conversion:Qn,priority:0}),sub:()=>({conversion:Qn,priority:0}),sup:()=>({conversion:Qn,priority:0}),u:()=>({conversion:Qn,priority:0})}}static importJSON(t){return Fe().updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setTextContent(t.text).setFormat(t.format).setDetail(t.detail).setMode(t.mode).setStyle(t.style)}exportDOM(t){let{element:n}=super.exportDOM(t);return Be(n)||q(132),n.style.whiteSpace="pre-wrap",this.hasFormat("lowercase")?n.style.textTransform="lowercase":this.hasFormat("uppercase")?n.style.textTransform="uppercase":this.hasFormat("capitalize")&&(n.style.textTransform="capitalize"),this.hasFormat("bold")&&(n=Sa(n,"b")),this.hasFormat("italic")&&(n=Sa(n,"i")),this.hasFormat("strikethrough")&&(n=Sa(n,"s")),this.hasFormat("underline")&&(n=Sa(n,"u")),{element:n}}exportJSON(){return{detail:this.getDetail(),format:this.getFormat(),mode:this.getMode(),style:this.getStyle(),text:this.getTextContent(),...super.exportJSON()}}selectionTransform(t,n){}setFormat(t){const n=this.getWritable();return n.__format=typeof t=="string"?jr[t]:t,n}setDetail(t){const n=this.getWritable();return n.__detail=typeof t=="string"?x3[t]:t,n}setStyle(t){const n=this.getWritable();return n.__style=t,n}toggleFormat(t){const n=Sl(this.getFormat(),t,null);return this.setFormat(n)}toggleDirectionless(){const t=this.getWritable();return t.__detail^=1,t}toggleUnmergeable(){const t=this.getWritable();return t.__detail^=2,t}setMode(t){const n=w3[t];if(this.__mode===n)return this;const r=this.getWritable();return r.__mode=n,r}setTextContent(t){if(this.__text===t)return this;const n=this.getWritable();return n.__text=t,n}select(t,n){ut();let r=t,o=n;const i=Y(),s=this.getTextContent(),a=this.__key;if(typeof s=="string"){const l=s.length;r===void 0&&(r=l),o===void 0&&(o=l)}else r=0,o=0;if(!W(i))return hb(a,r,a,o,"text","text");{const l=kr();l!==i.anchor.key&&l!==i.focus.key||gt(a),i.setTextNodeRange(this,r,this,o)}return i}selectStart(){return this.select(0,0)}selectEnd(){const t=this.getTextContentSize();return this.select(t,t)}spliceText(t,n,r,o){const i=this.getWritable(),s=i.__text,a=r.length;let l=t;l<0&&(l=a+l,l<0&&(l=0));const c=Y();if(o&&W(c)){const f=t+a;c.setTextNodeRange(i,f,i,f)}const u=s.slice(0,l)+r+s.slice(l+n);return i.__text=u,i}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...t){ut();const n=this.getLatest(),r=n.getTextContent();if(r==="")return[];const o=n.__key,i=kr(),s=r.length;t.sort((T,k)=>T-k),t.push(s);const a=[],l=t.length;for(let T=0,k=0;T<s&&k<=l;k++){const P=t[k];P>T&&(a.push(r.slice(T,P)),T=P)}const c=a.length;if(c===1)return[n];const u=a[0],f=n.getParent();let d;const h=n.getFormat(),g=n.getStyle(),p=n.__detail;let m=!1,x=null,y=null;const v=Y();if(W(v)){const[T,k]=v.isBackward()?[v.focus,v.anchor]:[v.anchor,v.focus];T.type==="text"&&T.key===o&&(x=T),k.type==="text"&&k.key===o&&(y=k)}n.isSegmented()?(d=Fe(u),d.__format=h,d.__style=g,d.__detail=p,d.__state=dm(n,d),m=!0):d=n.setTextContent(u);const b=[d];for(let T=1;T<c;T++){const k=Fe(a[T]);k.__format=h,k.__style=g,k.__detail=p,k.__state=dm(n,k);const P=k.__key;i===o&&gt(P),b.push(k)}const w=x?x.offset:null,_=y?y.offset:null;let E=0;for(const T of b){if(!x&&!y)break;const k=E+T.getTextContentSize();if(x!==null&&w!==null&&w<=k&&w>=E&&(x.set(T.getKey(),w-E,"text"),w<k&&(x=null)),y!==null&&_!==null&&_<=k&&_>=E){y.set(T.getKey(),_-E,"text");break}E=k}if(f!==null){(function(P){const O=P.getPreviousSibling(),D=P.getNextSibling();O!==null&&_l(O),D!==null&&_l(D)})(this);const T=f.getWritable(),k=this.getIndexWithinParent();m?(T.splice(k,0,b),this.remove()):T.splice(k,1,b),W(v)&&wl(v,f,k,c-1)}return b}mergeWithSibling(t){const n=t===this.getPreviousSibling();n||t===this.getNextSibling()||q(50);const r=this.__key,o=t.__key,i=this.__text,s=i.length;kr()===o&&gt(r);const a=Y();if(W(a)){const f=a.anchor,d=a.focus;f!==null&&f.key===o&&Pm(f,n,r,t,s),d!==null&&d.key===o&&Pm(d,n,r,t,s)}const l=t.__text,c=n?l+i:i+l;this.setTextContent(c);const u=this.getWritable();return t.remove(),u}isTextEntity(){return!1}}function eA(e){return{forChild:yh(e.style),node:null}}function tA(e){const t=e,n=t.style.fontWeight==="normal";return{forChild:yh(t.style,n?void 0:"bold"),node:null}}const Sm=new WeakMap;function nA(e){if(!Be(e))return!1;if(e.nodeName==="PRE")return!0;const t=e.style.whiteSpace;return typeof t=="string"&&t.startsWith("pre")}function rA(e){const t=e;e.parentElement===null&&q(129);let n=t.textContent||"";if((function(r){let o,i=r.parentNode;const s=[r];for(;i!==null&&(o=Sm.get(i))===void 0&&!nA(i);)s.push(i),i=i.parentNode;const a=o===void 0?i:o;for(let l=0;l<s.length;l++)Sm.set(s[l],a);return a})(t)!==null){const r=n.split(/(\r?\n|\t)/),o=[],i=r.length;for(let s=0;s<i;s++){const a=r[s];a===`
36
+ `,w3=ko?" ":Zl,Hr={bold:1,capitalize:1024,code:16,highlight:Lb,italic:2,lowercase:256,strikethrough:4,subscript:32,superscript:64,underline:8,uppercase:512},C3={directionless:1,unmergeable:2},cm={center:2,end:6,justify:4,left:1,right:3,start:5},S3={[m3]:"center",[b3]:"end",[v3]:"justify",[p3]:"left",[y3]:"right",[x3]:"start"},_3={normal:0,segmented:2,token:1},T3={[f3]:"normal",[g3]:"segmented",[h3]:"token"},um="$config";function Fb(e,t,n,r,o,i){let s=e.getFirstChild();for(;s!==null;){const a=s.__key;s.__parent===t&&(B(s)&&Fb(s,a,n,r,o,i),n.has(a)||i.delete(a),o.push(a)),s=s.getNextSibling()}}let Nd=!1,ph=0;function E3(e){ph=e.timeStamp}function Qc(e,t,n){const r=e.nodeName==="BR",o=t.__lexicalLineBreak;return o&&(e===o||r&&e.previousSibling===o)||r&&cc(e,n)!==void 0}function R3(e,t,n){const r=Ot(hn(n));let o=null,i=null;r!==null&&r.anchorNode===e&&(o=r.anchorOffset,i=r.focusOffset);const s=e.nodeValue;s!==null&&Ih(t,s,o,i,!1)}function k3(e,t,n){if(W(e)){const r=e.anchor.getNode();if(r.is(n)&&e.format!==r.getFormat())return!1}return Cr(t)&&n.isAttached()}function A3(e,t,n,r){for(let o=e;o&&!LA(o);o=la(o)){const i=cc(o,t);if(i!==void 0){const s=Pe(i,n);if(s)return Te(s)||!Be(o)?void 0:[o,s]}else if(o===r)return[r,$1(n)]}}function $b(e,t,n){Nd=!0;const r=performance.now()-ph>100;try{Un(e,()=>{const o=X()||(function(d){return d.getEditorState().read(()=>{const h=X();return h!==null?h.clone():null})})(e),i=new Map,s=e.getRootElement(),a=e._editorState,l=e._blockCursorElement;let c=!1,u="";for(let d=0;d<t.length;d++){const h=t[d],g=h.type,p=h.target,m=A3(p,e,a,s);if(!m)continue;const[v,y]=m;if(g==="characterData")r&&J(y)&&Cr(p)&&k3(o,p,y)&&R3(p,y,e);else if(g==="childList"){c=!0;const x=h.addedNodes;for(let _=0;_<x.length;_++){const E=x[_],R=L1(E),k=E.parentNode;if(k!=null&&E!==l&&R===null&&!Qc(E,k,e)){if(ko){const M=(Be(E)?E.innerText:null)||E.nodeValue;M&&(u+=M)}k.removeChild(E)}}const b=h.removedNodes,w=b.length;if(w>0){let _=0;for(let E=0;E<w;E++){const R=b[E];(Qc(R,p,e)||l===R)&&(p.appendChild(R),_++)}w!==_&&i.set(v,y)}}}if(i.size>0)for(const[d,h]of i)h.reconcileObservedMutation(d,e);const f=n.takeRecords();if(f.length>0){for(let d=0;d<f.length;d++){const h=f[d],g=h.addedNodes,p=h.target;for(let m=0;m<g.length;m++){const v=g[m],y=v.parentNode;y==null||v.nodeName!=="BR"||Qc(v,p,e)||y.removeChild(v)}}n.takeRecords()}o!==null&&(c&&Ge(o),ko&&j1(e)&&o.insertRawText(u))})}finally{Nd=!1}}function Ob(e){const t=e._observer;t!==null&&$b(e,t.takeRecords(),t)}function Ib(e){(function(t){ph===0&&hn(t).addEventListener("textInput",E3,!0)})(e),e._observer=new MutationObserver((t,n)=>{$b(e,t,n)})}let N3=class{key;parse;unparse;isEqual;defaultValue;constructor(t,n){this.key=t,this.parse=n.parse.bind(n),this.unparse=(n.unparse||F3).bind(n),this.isEqual=(n.isEqual||Object.is).bind(n),this.defaultValue=this.parse(void 0)}};function M3(e,t){return new N3(e,t)}function Db(e,t,n="latest"){const r=(n==="latest"?e.getLatest():e).__state;return r?r.getValue(t):t.defaultValue}function eu(e,t,n){let r;if(ft(),typeof n=="function"){const i=e.getLatest(),s=Db(i,t);if(r=n(s),t.isEqual(s,r))return i}else r=n;const o=e.getWritable();return Vb(o).updateFromKnown(t,r),o}function P3(e){const t=new Map,n=new Set;for(let r=typeof e=="function"?e:e.replace;r.prototype&&r.prototype.getType!==void 0;r=Object.getPrototypeOf(r)){const{ownNodeConfig:o}=dc(r);if(o&&o.stateConfigs)for(const i of o.stateConfigs){let s;"stateConfig"in i?(s=i.stateConfig,i.flat&&n.add(s.key)):s=i,t.set(s.key,s)}}return{flatKeys:n,sharedConfigMap:t}}let L3=class jb{node;knownState;unknownState;sharedNodeState;size;constructor(t,n,r=void 0,o=new Map,i=void 0){this.node=t,this.sharedNodeState=n,this.unknownState=r,this.knownState=o;const{sharedConfigMap:s}=this.sharedNodeState,a=i!==void 0?i:(function(l,c,u){let f=u.size;if(c)for(const d in c){const h=l.get(d);h&&u.has(h)||f++}return f})(s,r,o);this.size=a}getValue(t){const n=this.knownState.get(t);if(n!==void 0)return n;this.sharedNodeState.sharedConfigMap.set(t.key,t);let r=t.defaultValue;if(this.unknownState&&t.key in this.unknownState){const o=this.unknownState[t.key];o!==void 0&&(r=t.parse(o)),this.updateFromKnown(t,r)}return r}getInternalState(){return[this.unknownState,this.knownState]}toJSON(){const t={...this.unknownState},n={};for(const[r,o]of this.knownState)r.isEqual(o,r.defaultValue)?delete t[r.key]:t[r.key]=r.unparse(o);for(const r of this.sharedNodeState.flatKeys)r in t&&(n[r]=t[r],delete t[r]);return dm(t)&&(n.$=t),n}getWritable(t){if(this.node===t)return this;const{sharedNodeState:n,unknownState:r}=this,o=new Map(this.knownState);return new jb(t,n,(function(i,s,a){let l;if(a)for(const[c,u]of Object.entries(a)){const f=i.get(c);f?s.has(f)||s.set(f,f.parse(u)):(l=l||{},l[c]=u)}return l})(n.sharedConfigMap,o,r),o,this.size)}updateFromKnown(t,n){const r=t.key;this.sharedNodeState.sharedConfigMap.set(r,t);const{knownState:o,unknownState:i}=this;o.has(t)||i&&r in i||(i&&(delete i[r],this.unknownState=dm(i)),this.size++),o.set(t,n)}updateFromUnknown(t,n){const r=this.sharedNodeState.sharedConfigMap.get(t);r?this.updateFromKnown(r,r.parse(n)):(this.unknownState=this.unknownState||{},t in this.unknownState||this.size++,this.unknownState[t]=n)}updateFromJSON(t){const{knownState:n}=this;for(const r of n.keys())n.set(r,r.defaultValue);if(this.size=n.size,this.unknownState=void 0,t)for(const[r,o]of Object.entries(t))this.updateFromUnknown(r,o)}};function Vb(e){const t=e.getWritable(),n=t.__state?t.__state.getWritable(t):new L3(t,Bb(t));return t.__state=n,n}function Bb(e){return e.__state?e.__state.sharedNodeState:R1(Zi(),e.getType()).sharedNodeState}function dm(e){if(e)for(const t in e)return e}function F3(e){return e}function fm(e,t,n){for(const[r,o]of t.knownState){if(e.has(r.key))continue;e.add(r.key);const i=n?n.getValue(r):r.defaultValue;if(i!==o&&!r.isEqual(i,o))return!0}return!1}function hm(e,t,n){const{unknownState:r}=t,o=n?n.unknownState:void 0;if(r){for(const[i,s]of Object.entries(r))if(!e.has(i)&&(e.add(i),s!==(o?o[i]:void 0)))return!0}return!1}function gm(e,t){const n=e.__state;return n&&n.node===e?n.getWritable(t):n}function pm(e,t){const n=e.__mode,r=e.__format,o=e.__style,i=t.__mode,s=t.__format,a=t.__style,l=e.__state,c=t.__state;return(n===null||n===i)&&(r===null||r===s)&&(o===null||o===a)&&(e.__state===null||l===c||(function(u,f){if(u===f)return!0;if(u&&f&&u.size!==f.size)return!1;const d=new Set;return!(u&&fm(d,u,f)||f&&fm(d,f,u)||u&&hm(d,u,f)||f&&hm(d,f,u))})(l,c))}function mm(e,t){const n=e.mergeWithSibling(t),r=$e()._normalizedNodes;return r.add(e.__key),r.add(t.__key),n}function ym(e){let t,n,r=e;if(r.__text!==""||!r.isSimpleText()||r.isUnmergeable()){for(;(t=r.getPreviousSibling())!==null&&J(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(t.__text!==""){if(pm(t,r)){r=mm(t,r);break}break}t.remove()}for(;(n=r.getNextSibling())!==null&&J(n)&&n.isSimpleText()&&!n.isUnmergeable();){if(n.__text!==""){if(pm(r,n)){r=mm(r,n);break}break}n.remove()}}else r.remove()}function Bs(e){return vm(e.anchor),vm(e.focus),e}function vm(e){for(;e.type==="element";){const t=e.getNode(),n=e.offset;let r,o;if(n===t.getChildrenSize()?(r=t.getChildAtIndex(n-1),o=!0):(r=t.getChildAtIndex(n),o=!1),J(r)){e.set(r.__key,o?r.getTextContentSize():0,"text",!0);break}if(!B(r))break;e.set(r.__key,o?r.getChildrenSize():0,"element",!0)}}let Ao,_t,zs,Jl,Md,Pd,No,En,Ld,Hs,ut="",Dn=null,fo=null,lr="",ci=!1,wl=!1;function Cl(e,t){const n=No.get(e);if(t!==null){const r=Id(e);r.parentNode===t&&t.removeChild(r)}if(En.has(e)||_t._keyToDOMMap.delete(e),B(n)){const r=_l(n,No);Fd(r,0,r.length-1,null)}n!==void 0&&Dh(Hs,zs,Jl,n,"destroyed")}function Fd(e,t,n,r){let o=t;for(;o<=n;++o){const i=e[o];i!==void 0&&Cl(i,r)}}function lo(e,t){e.setProperty("text-align",t)}const $3="40px";function zb(e,t){const n=Ao.theme.indent;if(typeof n=="string"){const o=e.classList.contains(n);t>0&&!o?e.classList.add(n):t<1&&o&&e.classList.remove(n)}const r=getComputedStyle(e).getPropertyValue("--lexical-indent-base-value")||$3;e.style.setProperty("padding-inline-start",t===0?"":`calc(${t} * ${r})`)}function Hb(e,t){const n=e.style;t===0?lo(n,""):t===1?lo(n,"left"):t===2?lo(n,"center"):t===3?lo(n,"right"):t===4?lo(n,"justify"):t===5?lo(n,"start"):t===6&&lo(n,"end")}function $d(e,t){const n=(function(r){const o=r.__dir;if(o!==null)return o;if(at(r))return null;const i=r.getParentOrThrow();return at(i)&&i.__dir===null?"auto":null})(t);n!==null?e.dir=n:e.removeAttribute("dir")}function Sl(e,t){const n=En.get(e);n===void 0&&Y(60);const r=n.createDOM(Ao,_t);if((function(o,i,s){const a=s._keyToDOMMap;(function(l,c,u){const f=`__lexicalKey_${c._key}`;l[f]=u})(i,s,o),a.set(o,i)})(e,r,_t),J(n)?r.setAttribute("data-lexical-text","true"):Te(n)&&r.setAttribute("data-lexical-decorator","true"),B(n)){const o=n.__indent,i=n.__size;if($d(r,n),o!==0&&zb(r,o),i!==0){const a=i-1;Od(_l(n,En),n,0,a,n.getDOMSlot(r))}const s=n.__format;s!==0&&Hb(r,s),n.isInline()||Wb(null,n,r),uc(n)&&(ut+=zr,lr+=zr)}else{const o=n.getTextContent();if(Te(n)){const i=n.decorate(_t,Ao);i!==null&&Kb(e,i),r.contentEditable="false"}ut+=o,lr+=o}return t!==null&&t.insertChild(r),Dh(Hs,zs,Jl,n,"created"),r}function Od(e,t,n,r,o){const i=ut;ut="";let s=n;for(;s<=r;++s){Sl(e[s],o);const a=En.get(e[s]);a!==null&&J(a)&&Dn===null&&(Dn=a.getFormat(),fo=a.getStyle())}uc(t)&&(ut+=zr),o.element.__lexicalTextContent=ut,ut=i+ut}function xm(e,t){if(e){const n=e.__last;if(n){const r=t.get(n);if(r)return Kn(r)?"line-break":Te(r)&&r.isInline()?"decorator":null}return"empty"}return null}function Wb(e,t,n){const r=xm(e,No),o=xm(t,En);r!==o&&t.getDOMSlot(n).setManagedLineBreak(o)}function O3(e,t,n){var r;Dn=null,fo=null,(function(o,i,s){const a=ut,l=o.__size,c=i.__size;ut="";const u=s.element;if(l===1&&c===1){const f=o.__first,d=i.__first;if(f===d)ws(f,u);else{const g=Id(f),p=Sl(d,null);try{u.replaceChild(p,g)}catch(m){if(typeof m=="object"&&m!=null){const v=`${m.toString()} Parent: ${u.tagName}, new child: {tag: ${p.tagName} key: ${d}}, old child: {tag: ${g.tagName}, key: ${f}}.`;throw new Error(v)}throw m}Cl(f,null)}const h=En.get(d);J(h)&&Dn===null&&(Dn=h.getFormat(),fo=h.getStyle())}else{const f=_l(o,No),d=_l(i,En);if(f.length!==l&&Y(227),d.length!==c&&Y(228),l===0)c!==0&&Od(d,i,0,c-1,s);else if(c===0){if(l!==0){const h=s.after==null&&s.before==null&&s.element.__lexicalLineBreak==null;Fd(f,0,l-1,h?null:u),h&&(u.textContent="")}}else(function(h,g,p,m,v,y){const x=m-1,b=v-1;let w,_,E=y.getFirstChild(),R=0,k=0;for(;R<=x&&k<=b;){const D=g[R],j=p[k];if(D===j)E=tu(ws(j,y.element)),R++,k++;else{w===void 0&&(w=new Set(g)),_===void 0&&(_=new Set(p));const $=_.has(D),H=w.has(j);if($)if(H){const O=Lo(_t,j);O===E?E=tu(ws(j,y.element)):(y.withBefore(E).insertChild(O),ws(j,y.element)),R++,k++}else Sl(j,y.withBefore(E)),k++;else E=tu(Id(D)),Cl(D,y.element),R++}const I=En.get(j);I!==null&&J(I)&&Dn===null&&(Dn=I.getFormat(),fo=I.getStyle())}const M=R>x,F=k>b;if(M&&!F){const D=p[b+1],j=D===void 0?null:_t.getElementByKey(D);Od(p,h,k,b,y.withBefore(j))}else F&&!M&&Fd(g,R,x,y.element)})(i,f,d,l,c,s)}uc(i)&&(ut+=zr),u.__lexicalTextContent=ut,ut=a+ut})(e,t,t.getDOMSlot(n)),r=t,Dn==null||Dn===r.__textFormat||wl||r.setTextFormat(Dn),(function(o){fo==null||fo===o.__textStyle||wl||o.setTextStyle(fo)})(t)}function _l(e,t){const n=[];let r=e.__first;for(;r!==null;){const o=t.get(r);o===void 0&&Y(101),n.push(r),r=o.__next}return n}function ws(e,t){const n=No.get(e);let r=En.get(e);n!==void 0&&r!==void 0||Y(61);const o=ci||Pd.has(e)||Md.has(e),i=Lo(_t,e);if(n===r&&!o){if(B(n)){const s=i.__lexicalTextContent;s!==void 0&&(ut+=s,lr+=s)}else{const s=n.getTextContent();lr+=s,ut+=s}return i}if(n!==r&&o&&Dh(Hs,zs,Jl,r,"updated"),r.updateDOM(n,i,Ao)){const s=Sl(e,null);return t===null&&Y(62),t.replaceChild(s,i),Cl(e,null),s}if(B(n)&&B(r)){const s=r.__indent;(ci||s!==n.__indent)&&zb(i,s);const a=r.__format;if((ci||a!==n.__format)&&Hb(i,a),o&&(O3(n,r,i),at(r)||r.isInline()||Wb(n,r,i)),uc(r)&&(ut+=zr,lr+=zr),(ci||r.__dir!==n.__dir)&&($d(i,r),at(r)&&!ci))for(const l of r.getChildren())B(l)&&$d(Lo(_t,l.getKey()),l)}else{const s=r.getTextContent();if(Te(r)){const a=r.decorate(_t,Ao);a!==null&&Kb(e,a)}ut+=s,lr+=s}if(!wl&&at(r)&&r.__cachedText!==lr){const s=r.getWritable();s.__cachedText=lr,r=s}return i}function Kb(e,t){let n=_t._pendingDecorators;const r=_t._decorators;if(n===null){if(r[e]===t)return;n=F1(_t)}n[e]=t}function tu(e){let t=e.nextSibling;return t!==null&&t===_t._blockCursorElement&&(t=t.nextSibling),t}function I3(e,t,n,r,o,i){ut="",lr="",ci=r===2,_t=n,Ao=n._config,zs=n._nodes,Jl=_t._listeners.mutation,Md=o,Pd=i,No=e._nodeMap,En=t._nodeMap,wl=t._readOnly,Ld=new Map(n._keyToDOMMap);const s=new Map;return Hs=s,ws("root",null),_t=void 0,zs=void 0,Md=void 0,Pd=void 0,No=void 0,En=void 0,Ao=void 0,Ld=void 0,Hs=void 0,s}function Id(e){const t=Ld.get(e);return t===void 0&&Y(75,e),t}function ce(e){return{type:e}}const fr=ce("SELECTION_CHANGE_COMMAND"),mh=ce("SELECTION_INSERT_CLIPBOARD_NODES_COMMAND"),Ql=ce("CLICK_COMMAND"),Ub=ce("BEFORE_INPUT_COMMAND"),Gb=ce("INPUT_COMMAND"),qb=ce("COMPOSITION_START_COMMAND"),Yb=ce("COMPOSITION_END_COMMAND"),Ir=ce("DELETE_CHARACTER_COMMAND"),Si=ce("INSERT_LINE_BREAK_COMMAND"),Mo=ce("INSERT_PARAGRAPH_COMMAND"),To=ce("CONTROLLED_TEXT_INSERTION_COMMAND"),yh=ce("PASTE_COMMAND"),Dd=ce("REMOVE_TEXT_COMMAND"),$i=ce("DELETE_WORD_COMMAND"),Po=ce("DELETE_LINE_COMMAND"),Vt=ce("FORMAT_TEXT_COMMAND"),Xb=ce("UNDO_COMMAND"),Zb=ce("REDO_COMMAND"),Jb=ce("KEYDOWN_COMMAND"),vh=ce("KEY_ARROW_RIGHT_COMMAND"),D3=ce("MOVE_TO_END"),xh=ce("KEY_ARROW_LEFT_COMMAND"),j3=ce("MOVE_TO_START"),bh=ce("KEY_ARROW_UP_COMMAND"),wh=ce("KEY_ARROW_DOWN_COMMAND"),Tl=ce("KEY_ENTER_COMMAND"),Qb=ce("KEY_SPACE_COMMAND"),ec=ce("KEY_BACKSPACE_COMMAND"),Ch=ce("KEY_ESCAPE_COMMAND"),Sh=ce("KEY_DELETE_COMMAND"),_h=ce("KEY_TAB_COMMAND"),V3=ce("INSERT_TAB_COMMAND"),B3=ce("INDENT_CONTENT_COMMAND"),bm=ce("OUTDENT_CONTENT_COMMAND"),e1=ce("DROP_COMMAND"),_i=ce("FORMAT_ELEMENT_COMMAND"),t1=ce("DRAGSTART_COMMAND"),n1=ce("DRAGOVER_COMMAND"),z3=ce("DRAGEND_COMMAND"),tc=ce("COPY_COMMAND"),nc=ce("CUT_COMMAND"),jd=ce("SELECT_ALL_COMMAND"),r1=ce("FOCUS_COMMAND"),H3=ce("BLUR_COMMAND"),W3=ce("KEY_MODIFIER_COMMAND"),tr=Object.freeze({}),Vd=[["keydown",function(e,t){Ws=e.timeStamp,o1=e.key,!t.isComposing()&&te(t,Jb,e)}],["pointerdown",function(e,t){const n=e.target,r=e.pointerType;Cn(n)&&r!=="touch"&&r!=="pen"&&e.button===0&&Un(t,()=>{k1(n)||(Hd=!0)})}],["compositionstart",function(e,t){te(t,qb,e)}],["compositionend",function(e,t){ko?Cs=!0:Ki||!ra&&!oa?te(t,Yb,e):(Wd=!0,Kd=e.data)}],["input",function(e,t){e.stopPropagation(),Un(t,()=>{t.dispatchCommand(Gb,e)},{event:e}),ui=null}],["click",function(e,t){Un(t,()=>{const n=X(),r=Ot(hn(t)),o=Zn();if(r){if(W(n)){const i=n.anchor,s=i.getNode();if(i.type==="element"&&i.offset===0&&n.isCollapsed()&&!at(s)&&qe().getChildrenSize()===1&&s.getTopLevelElementOrThrow().isEmpty()&&o!==null&&n.is(o))r.removeAllRanges(),n.dirty=!0;else if(e.detail===3&&!n.isCollapsed()&&s!==n.focus.getNode()){const a=we(s,l=>B(l)&&!l.isInline());B(a)&&a.select(0)}}else if(e.pointerType==="touch"||e.pointerType==="pen"){const i=r.anchorNode;(Be(i)||Cr(i))&&Ge(sc(o,r,t,e))}}te(t,Ql,e)})}],["cut",tr],["copy",tr],["dragstart",tr],["dragover",tr],["dragend",tr],["paste",tr],["focus",tr],["blur",tr],["drop",tr]];bl&&Vd.push(["beforeinput",(e,t)=>(function(n,r){const o=n.inputType;o==="deleteCompositionText"||ko&&j1(r)||o!=="insertCompositionText"&&te(r,Ub,n)})(e,t)]);let Ws=0,o1=null,i1=0,ui=null;const Bd=new WeakMap,El=new WeakMap;let zd=!1,Hd=!1,ks=!1,Cs=!1,Wd=!1,Kd="",yo=null,s1=[0,"",0,"root",0];function a1(e,t,n,r,o){const i=e.anchor,s=e.focus,a=i.getNode(),l=$e(),c=Ot(hn(l)),u=c!==null?c.anchorNode:null,f=i.key,d=l.getElementByKey(f),h=n.length;return f!==s.key||!J(a)||(!o&&(!bl||i1<r+50)||a.isDirty()&&h<2||O1(n))&&i.offset!==s.offset&&!a.isComposing()||sr(a)||a.isDirty()&&h>1||(o||!bl)&&d!==null&&!a.isComposing()&&u!==Ii(d)||c!==null&&t!==null&&(!t.collapsed||t.startContainer!==c.anchorNode||t.startOffset!==c.anchorOffset)||a.getFormat()!==e.format||a.getStyle()!==e.style||(function(g,p){if(p.isSegmented())return!0;if(!g.isCollapsed())return!1;const m=g.anchor.offset,v=p.getParentOrThrow(),y=Eo(p);return m===0?!p.canInsertTextBefore()||!v.canInsertTextBefore()&&!p.isComposing()||y||(function(x){const b=x.getPreviousSibling();return(J(b)||B(b)&&b.isInline())&&!b.canInsertTextAfter()})(p):m===p.getTextContentSize()&&(!p.canInsertTextAfter()||!v.canInsertTextAfter()&&!p.isComposing()||y)})(e,a)}function wm(e,t){return Cr(e)&&e.nodeValue!==null&&t!==0&&t!==e.nodeValue.length}function Cm(e,t,n){const{anchorNode:r,anchorOffset:o,focusNode:i,focusOffset:s}=e;zd&&(zd=!1,wm(r,o)&&wm(i,s)&&!yo)||Un(t,()=>{if(!n)return void Ge(null);if(!aa(t,r,i))return;let a=X();if(yo&&W(a)&&a.isCollapsed()){const l=a.anchor,c=yo.anchor;(l.key===c.key&&l.offset===c.offset+1||l.offset===1&&c.getNode().is(l.getNode().getPreviousSibling()))&&(a=yo.clone(),Ge(a))}if(yo=null,W(a)){const l=a.anchor,c=l.getNode();if(a.isCollapsed()){e.type==="Range"&&e.anchorNode===e.focusNode&&(a.dirty=!0);const u=hn(t).event,f=u?u.timeStamp:performance.now(),[d,h,g,p,m]=s1,v=qe(),y=t.isComposing()===!1&&v.getTextContent()==="";if(f<m+200&&l.offset===g&&l.key===p)rl(a,d,h);else if(l.type==="text")J(c)||Y(141),l1(a,c);else if(l.type==="element"&&!y){B(c)||Y(259);const x=l.getNode();x.isEmpty()?(function(b,w){const _=w.getTextFormat(),E=w.getTextStyle();rl(b,_,E)})(a,x):rl(a,0,"")}}else{const u=l.key,f=a.focus.key,d=a.getNodes(),h=d.length,g=a.isBackward(),p=g?s:o,m=g?o:s,v=g?f:u,y=g?u:f;let x=2047,b=!1;for(let w=0;w<h;w++){const _=d[w],E=_.getTextContentSize();if(J(_)&&E!==0&&!(w===0&&_.__key===v&&p===E||w===h-1&&_.__key===y&&m===0)&&(b=!0,x&=_.getFormat(),x===0))break}a.format=b?x:0}}te(t,fr,void 0)})}function rl(e,t,n){e.format===t&&e.style===n||(e.format=t,e.style=n,e.dirty=!0)}function l1(e,t){rl(e,t.getFormat(),t.getStyle())}function c1(e){if(!e.getTargetRanges)return null;const t=e.getTargetRanges();return t.length===0?null:t[0]}function K3(e){const t=e.inputType,n=c1(e),r=$e(),o=X();if(t==="deleteContentBackward"){if(o===null){const f=Zn();if(!W(f))return!0;Ge(f.clone())}if(W(o)){const f=o.anchor.key===o.focus.key;if(i=e.timeStamp,o1==="MediaLast"&&i<Ws+30&&r.isComposing()&&f){if(yt(null),Ws=0,setTimeout(()=>{Un(r,()=>{yt(null)})},30),W(o)){const d=o.anchor.getNode();d.markDirty(),J(d)||Y(142),l1(o,d)}}else{yt(null),e.preventDefault();const d=o.anchor.getNode(),h=d.getTextContent(),g=d.canInsertTextAfter(),p=o.anchor.offset===0&&o.focus.offset===h.length;let m=lm&&f&&!p&&g;if(m&&o.isCollapsed()&&(m=!Te(Xd(o.anchor,!0))),!m){te(r,Ir,!0);const v=X();lm&&W(v)&&v.isCollapsed()&&(yo=v,setTimeout(()=>yo=null))}}return!0}}var i;if(!W(o))return!0;const s=e.data;ui!==null&&Oh(!1,r,ui),o.dirty&&ui===null||!o.isCollapsed()||at(o.anchor.getNode())||n===null||o.applyDOMRange(n),ui=null;const a=o.anchor,l=o.focus,c=a.getNode(),u=l.getNode();if(t==="insertText"||t==="insertTranspose"){if(s===`
37
+ `)e.preventDefault(),te(r,Si,!1);else if(s===zr)e.preventDefault(),te(r,Mo,void 0);else if(s==null&&e.dataTransfer){const f=e.dataTransfer.getData("text/plain");e.preventDefault(),o.insertRawText(f)}else s!=null&&a1(o,n,s,e.timeStamp,!0)?(e.preventDefault(),te(r,To,s)):ui=s;return i1=e.timeStamp,!0}switch(e.preventDefault(),t){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":te(r,To,e);break;case"insertFromComposition":yt(null),te(r,To,e);break;case"insertLineBreak":yt(null),te(r,Si,!1);break;case"insertParagraph":yt(null),ks&&!Ki?(ks=!1,te(r,Si,!1)):te(r,Mo,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":te(r,yh,e);break;case"deleteByComposition":(function(f,d){return f!==d||B(f)||B(d)||!Eo(f)||!Eo(d)})(c,u)&&te(r,Dd,e);break;case"deleteByDrag":case"deleteByCut":te(r,Dd,e);break;case"deleteContent":te(r,Ir,!1);break;case"deleteWordBackward":te(r,$i,!0);break;case"deleteWordForward":te(r,$i,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":te(r,Po,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":te(r,Po,!1);break;case"formatStrikeThrough":te(r,Vt,"strikethrough");break;case"formatBold":te(r,Vt,"bold");break;case"formatItalic":te(r,Vt,"italic");break;case"formatUnderline":te(r,Vt,"underline");break;case"historyUndo":te(r,Xb,void 0);break;case"historyRedo":te(r,Zb,void 0)}return!0}function U3(e){if(Be(e.target)&&k1(e.target))return!0;const t=$e(),n=X(),r=e.data,o=c1(e);if(r!=null&&W(n)&&a1(n,o,r,e.timeStamp,!1)){Cs&&(Rl(t,r),Cs=!1);const i=n.anchor.getNode(),s=Ot(hn(t));if(s===null)return!0;const a=n.isBackward(),l=a?n.anchor.offset:n.focus.offset,c=a?n.focus.offset:n.anchor.offset;bl&&!n.isCollapsed()&&J(i)&&s.anchorNode!==null&&i.getTextContent().slice(0,l)+r+i.getTextContent().slice(l+c)===D1(s.anchorNode)||te(t,To,r);const u=r.length;ko&&u>1&&e.inputType==="insertCompositionText"&&!t.isComposing()&&(n.anchor.offset-=u),ra||Ki||oa||!t.isComposing()||(Ws=0,yt(null))}else Oh(!1,t,r!==null?r:void 0),Cs&&(Rl(t,r||void 0),Cs=!1);return(function(){ft();const i=$e();Ob(i)})(),!0}function G3(e){const t=$e(),n=X();if(W(n)&&!t.isComposing()){const r=n.anchor,o=n.anchor.getNode();yt(r.key),(e.timeStamp<Ws+30||r.type==="element"||!n.isCollapsed()||o.getFormat()!==n.format||J(o)&&o.getStyle()!==n.style)&&te(t,To,w3)}return!0}function q3(e){return Rl($e(),e.data),!0}function Rl(e,t){const n=e._compositionKey;if(yt(null),n!==null&&t!=null){if(t===""){const r=Pe(n),o=Ii(e.getElementByKey(n));return void(o!==null&&o.nodeValue!==null&&J(r)&&Ih(r,o.nodeValue,null,null,!0))}if(t[t.length-1]===`
38
+ `){const r=X();if(W(r)){const o=r.focus;return r.anchor.set(o.key,o.offset,o.type),void te(e,Tl,null)}}}Oh(!0,e,t)}function Y3(e){const t=$e();if(e.key==null)return!0;if(Wd&&Gm(e))return Un(t,()=>{Rl(t,Kd)}),Wd=!1,Kd="",!0;if((function(n){return Me(n,"ArrowRight",{shiftKey:"any"})})(e))te(t,vh,e);else if((function(n){return Me(n,"ArrowRight",rr)})(e))te(t,D3,e);else if((function(n){return Me(n,"ArrowLeft",{shiftKey:"any"})})(e))te(t,xh,e);else if((function(n){return Me(n,"ArrowLeft",rr)})(e))te(t,j3,e);else if((function(n){return Me(n,"ArrowUp",{altKey:"any",shiftKey:"any"})})(e))te(t,bh,e);else if((function(n){return Me(n,"ArrowDown",{altKey:"any",shiftKey:"any"})})(e))te(t,wh,e);else if((function(n){return Me(n,"Enter",{altKey:"any",ctrlKey:"any",metaKey:"any",shiftKey:!0})})(e))ks=!0,te(t,Tl,e);else if((function(n){return n.key===" "})(e))te(t,Qb,e);else if((function(n){return wn&&Me(n,"o",{ctrlKey:!0})})(e))e.preventDefault(),ks=!0,te(t,Si,!0);else if((function(n){return Me(n,"Enter",{altKey:"any",ctrlKey:"any",metaKey:"any"})})(e))ks=!1,te(t,Tl,e);else if((function(n){return Me(n,"Backspace",{shiftKey:"any"})||wn&&Me(n,"h",{ctrlKey:!0})})(e))Gm(e)?te(t,ec,e):(e.preventDefault(),te(t,Ir,!0));else if((function(n){return n.key==="Escape"})(e))te(t,Ch,e);else if((function(n){return Me(n,"Delete",{})||wn&&Me(n,"d",{ctrlKey:!0})})(e))(function(n){return n.key==="Delete"})(e)?te(t,Sh,e):(e.preventDefault(),te(t,Ir,!1));else if((function(n){return Me(n,"Backspace",Um)})(e))e.preventDefault(),te(t,$i,!0);else if((function(n){return Me(n,"Delete",Um)})(e))e.preventDefault(),te(t,$i,!1);else if((function(n){return wn&&Me(n,"Backspace",{metaKey:!0})})(e))e.preventDefault(),te(t,Po,!0);else if((function(n){return wn&&(Me(n,"Delete",{metaKey:!0})||Me(n,"k",{ctrlKey:!0}))})(e))e.preventDefault(),te(t,Po,!1);else if((function(n){return Me(n,"b",rr)})(e))e.preventDefault(),te(t,Vt,"bold");else if((function(n){return Me(n,"u",rr)})(e))e.preventDefault(),te(t,Vt,"underline");else if((function(n){return Me(n,"i",rr)})(e))e.preventDefault(),te(t,Vt,"italic");else if((function(n){return Me(n,"Tab",{shiftKey:"any"})})(e))te(t,_h,e);else if((function(n){return Me(n,"z",rr)})(e))e.preventDefault(),te(t,Xb,void 0);else if((function(n){return wn?Me(n,"z",{metaKey:!0,shiftKey:!0}):Me(n,"y",{ctrlKey:!0})||Me(n,"z",{ctrlKey:!0,shiftKey:!0})})(e))e.preventDefault(),te(t,Zb,void 0);else{const n=t._editorState._selection;n===null||W(n)?qm(e)&&(e.preventDefault(),te(t,jd,e)):(function(r){return Me(r,"c",rr)})(e)?(e.preventDefault(),te(t,tc,e)):(function(r){return Me(r,"x",rr)})(e)?(e.preventDefault(),te(t,nc,e)):qm(e)&&(e.preventDefault(),te(t,jd,e))}return(function(n){return n.ctrlKey||n.shiftKey||n.altKey||n.metaKey})(e)&&t.dispatchCommand(W3,e),!0}function u1(e){let t=e.__lexicalEventHandles;return t===void 0&&(t=[],e.__lexicalEventHandles=t),t}const Ti=new Map;function d1(e){const t=AA(e.target);if(t===null)return;const n=A1(t.anchorNode);if(n===null)return;Hd&&(Hd=!1,Un(n,()=>{const l=Zn(),c=t.anchorNode;(Be(c)||Cr(c))&&Ge(sc(l,t,n,e))}));const r=$h(n),o=r[r.length-1],i=o._key,s=Ti.get(i),a=s||o;a!==n&&Cm(t,a,!1),Cm(t,n,!0),n!==o?Ti.set(i,n):s&&Ti.delete(i)}function Sm(e){e._lexicalHandled=!0}function _m(e){return e._lexicalHandled===!0}function X3(e){const t=Bd.get(e);if(t===void 0)return;const n=El.get(t);if(n===void 0)return;const r=n-1;r>=0||Y(164),Bd.delete(e),El.set(t,r),r===0&&t.removeEventListener("selectionchange",d1);const o=lc(e);Fh(o)?((function(s){if(s._parentEditor!==null){const a=$h(s),l=a[a.length-1]._key;Ti.get(l)===s&&Ti.delete(l)}else Ti.delete(s._key)})(o),e.__lexicalEditor=null):o&&Y(198);const i=u1(e);for(let s=0;s<i.length;s++)i[s]();e.__lexicalEventHandles=[]}function Ud(e,t,n){ft();const r=e.__key,o=e.getParent();if(o===null)return;const i=(function(a){const l=X();if(!W(l)||!B(a))return l;const{anchor:c,focus:u}=l,f=c.getNode(),d=u.getNode();return Zd(f,a)&&c.set(a.__key,0,"element"),Zd(d,a)&&u.set(a.__key,0,"element"),l})(e);let s=!1;if(W(i)&&t){const a=i.anchor,l=i.focus;a.key===r&&(Nl(a,e,o,e.getPreviousSibling(),e.getNextSibling()),s=!0),l.key===r&&(Nl(l,e,o,e.getPreviousSibling(),e.getNextSibling()),s=!0)}else Ct(i)&&t&&e.isSelected()&&e.selectPrevious();if(W(i)&&t&&!s){const a=e.getIndexWithinParent();Ro(e),Al(i,o,a,-1)}else Ro(e);n||vt(o)||o.canBeEmpty()||!o.isEmpty()||Ud(o,t),t&&i&&at(o)&&o.isEmpty()&&o.selectEnd()}const f1=Symbol.for("ephemeral");function kl(e){return e[f1]||!1}class Wn{__type;__key;__parent;__prev;__next;__state;static getType(){const{ownNodeType:t}=dc(this);return t===void 0&&Y(64,this.name),t}static clone(t){Y(65,this.name)}$config(){return{}}config(t,n){const r=n.extends||Object.getPrototypeOf(this.constructor);return Object.assign(n,{extends:r,type:t}),{[t]:n}}afterCloneFrom(t){this.__key===t.__key?(this.__parent=t.__parent,this.__next=t.__next,this.__prev=t.__prev,this.__state=t.__state):t.__state&&(this.__state=t.__state.getWritable(this))}static importDOM;constructor(t){this.__type=this.constructor.getType(),this.__parent=null,this.__prev=null,this.__next=null,Object.defineProperty(this,"__state",{configurable:!0,enumerable:!1,value:void 0,writable:!0}),P1(this,t)}getType(){return this.__type}isInline(){Y(137,this.constructor.name)}isAttached(){let t=this.__key;for(;t!==null;){if(t==="root")return!0;const n=Pe(t);if(n===null)break;t=n.__parent}return!1}isSelected(t){const n=t||X();if(n==null)return!1;const r=n.getNodes().some(o=>o.__key===this.__key);if(J(this))return r;if(W(n)&&n.anchor.type==="element"&&n.focus.type==="element"){if(n.isCollapsed())return!1;const o=this.getParent();if(Te(this)&&this.isInline()&&o){const i=n.isBackward()?n.focus:n.anchor;if(o.is(i.getNode())&&i.offset===o.getChildrenSize()&&this.is(o.getLastChild()))return!1}}return r}getKey(){return this.__key}getIndexWithinParent(){const t=this.getParent();if(t===null)return-1;let n=t.getFirstChild(),r=0;for(;n!==null;){if(this.is(n))return r;r++,n=n.getNextSibling()}return-1}getParent(){const t=this.getLatest().__parent;return t===null?null:Pe(t)}getParentOrThrow(){const t=this.getParent();return t===null&&Y(66,this.__key),t}getTopLevelElement(){let t=this;for(;t!==null;){const n=t.getParent();if(vt(n))return B(t)||t===this&&Te(t)||Y(194),t;t=n}return null}getTopLevelElementOrThrow(){const t=this.getTopLevelElement();return t===null&&Y(67,this.__key),t}getParents(){const t=[];let n=this.getParent();for(;n!==null;)t.push(n),n=n.getParent();return t}getParentKeys(){const t=[];let n=this.getParent();for(;n!==null;)t.push(n.__key),n=n.getParent();return t}getPreviousSibling(){const t=this.getLatest().__prev;return t===null?null:Pe(t)}getPreviousSiblings(){const t=[],n=this.getParent();if(n===null)return t;let r=n.getFirstChild();for(;r!==null&&!r.is(this);)t.push(r),r=r.getNextSibling();return t}getNextSibling(){const t=this.getLatest().__next;return t===null?null:Pe(t)}getNextSiblings(){const t=[];let n=this.getNextSibling();for(;n!==null;)t.push(n),n=n.getNextSibling();return t}getCommonAncestor(t){const n=B(this)?this:this.getParent(),r=B(t)?t:t.getParent(),o=n&&r?il(n,r):null;return o?o.commonAncestor:null}is(t){return t!=null&&this.__key===t.__key}isBefore(t){const n=il(this,t);return n!==null&&(n.type==="descendant"||(n.type==="branch"?U1(n)===-1:(n.type!=="same"&&n.type!=="ancestor"&&Y(279),!1)))}isParentOf(t){const n=il(this,t);return n!==null&&n.type==="ancestor"}getNodesBetween(t){const n=this.isBefore(t),r=[],o=new Set;let i=this;for(;i!==null;){const s=i.__key;if(o.has(s)||(o.add(s),r.push(i)),i===t)break;const a=B(i)?n?i.getFirstChild():i.getLastChild():null;if(a!==null){i=a;continue}const l=n?i.getNextSibling():i.getPreviousSibling();if(l!==null){i=l;continue}const c=i.getParentOrThrow();if(o.has(c.__key)||r.push(c),c===t)break;let u=null,f=c;do{if(f===null&&Y(68),u=n?f.getNextSibling():f.getPreviousSibling(),f=f.getParent(),f===null)break;u!==null||o.has(f.__key)||r.push(f)}while(u===null);i=u}return n||r.reverse(),r}isDirty(){const t=$e()._dirtyLeaves;return t!==null&&t.has(this.__key)}getLatest(){if(kl(this))return this;const t=Pe(this.__key);return t===null&&Y(113),t}getWritable(){if(kl(this))return this;ft();const t=Jr(),n=$e(),r=t._nodeMap,o=this.__key,i=this.getLatest(),s=n._cloneNotNeeded,a=X();if(a!==null&&a.setCachedNodes(null),s.has(o))return Pl(i),i;const l=z1(i);return s.add(o),Pl(l),r.set(o,l),l}getTextContent(){return""}getTextContentSize(){return this.getTextContent().length}createDOM(t,n){Y(70)}updateDOM(t,n,r){Y(71)}exportDOM(t){return{element:this.createDOM(t._config,t)}}exportJSON(){const t=this.__state?this.__state.toJSON():void 0;return{type:this.__type,version:1,...t}}static importJSON(t){Y(18,this.name)}updateFromJSON(t){return(function(n,r){const o=n.getWritable(),i=r.$;let s=i;for(const a of Bb(o).flatKeys)a in r&&(s!==void 0&&s!==i||(s={...i}),s[a]=r[a]);return(o.__state||s)&&Vb(n).updateFromJSON(s),o})(this,t)}static transform(){return null}remove(t){Ud(this,!0,t)}replace(t,n){ft();let r=X();r!==null&&(r=r.clone()),au(this,t);const o=this.getLatest(),i=this.__key,s=t.__key,a=t.getWritable(),l=this.getParentOrThrow().getWritable(),c=l.__size;Ro(a);const u=o.getPreviousSibling(),f=o.getNextSibling(),d=o.__prev,h=o.__next,g=o.__parent;if(Ud(o,!1,!0),u===null?l.__first=s:u.getWritable().__next=s,a.__prev=d,f===null?l.__last=s:f.getWritable().__prev=s,a.__next=h,a.__parent=g,l.__size=c,n&&(B(this)&&B(a)||Y(139),this.getChildren().forEach(p=>{a.append(p)})),W(r)){Ge(r);const p=r.anchor,m=r.focus;p.key===i&&km(p,a),m.key===i&&km(m,a)}return Mr()===i&&yt(s),a}insertAfter(t,n=!0){ft(),au(this,t);const r=this.getWritable(),o=t.getWritable(),i=o.getParent(),s=X();let a=!1,l=!1;if(i!==null){const h=t.getIndexWithinParent();if(Ro(o),W(s)){const g=i.__key,p=s.anchor,m=s.focus;a=p.type==="element"&&p.key===g&&p.offset===h+1,l=m.type==="element"&&m.key===g&&m.offset===h+1}}const c=this.getNextSibling(),u=this.getParentOrThrow().getWritable(),f=o.__key,d=r.__next;if(c===null?u.__last=f:c.getWritable().__prev=f,u.__size++,r.__next=f,o.__next=d,o.__prev=r.__key,o.__parent=r.__parent,n&&W(s)){const h=this.getIndexWithinParent();Al(s,u,h+1);const g=u.__key;a&&s.anchor.set(g,h+2,"element"),l&&s.focus.set(g,h+2,"element")}return t}insertBefore(t,n=!0){ft(),au(this,t);const r=this.getWritable(),o=t.getWritable(),i=o.__key;Ro(o);const s=this.getPreviousSibling(),a=this.getParentOrThrow().getWritable(),l=r.__prev,c=this.getIndexWithinParent();s===null?a.__first=i:s.getWritable().__next=i,a.__size++,r.__prev=i,o.__prev=l,o.__next=r.__key,o.__parent=r.__parent;const u=X();return n&&W(u)&&Al(u,this.getParentOrThrow(),c),t}isParentRequired(){return!1}createParentElementNode(){return ve()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(t,n){ft();const r=this.getPreviousSibling(),o=this.getParentOrThrow();if(r===null)return o.select(0,0);if(B(r))return r.select();if(!J(r)){const i=r.getIndexWithinParent()+1;return o.select(i,i)}return r.select(t,n)}selectNext(t,n){ft();const r=this.getNextSibling(),o=this.getParentOrThrow();if(r===null)return o.select();if(B(r))return r.select(0,0);if(!J(r)){const i=r.getIndexWithinParent();return o.select(i,i)}return r.select(t,n)}markDirty(){this.getWritable()}reconcileObservedMutation(t,n){this.markDirty()}}const Z3="historic",Ei="history-merge",J3="paste",h1="collaboration",Q3="skip-scroll-into-view",eA="skip-dom-selection",tA="skip-selection-focus";class Ui extends Wn{static getType(){return"linebreak"}static clone(t){return new Ui(t.__key)}constructor(t){super(t)}getTextContent(){return`
39
+ `}createDOM(){return document.createElement("br")}updateDOM(){return!1}isInline(){return!0}static importDOM(){return{br:t=>(function(n){const r=n.parentElement;if(r!==null&&Ll(r)){const o=r.firstChild;if(o===n||o.nextSibling===n&&Na(o)){const i=r.lastChild;if(i===n||i.previousSibling===n&&Na(i))return!0}}return!1})(t)||(function(n){const r=n.parentElement;if(r!==null&&Ll(r)){const o=r.firstChild;if(o===n||o.nextSibling===n&&Na(o))return!1;const i=r.lastChild;if(i===n||i.previousSibling===n&&Na(i))return!0}return!1})(t)?null:{conversion:nA,priority:0}}}static importJSON(t){return kn().updateFromJSON(t)}}function nA(e){return{node:kn()}}function kn(){return Et(new Ui)}function Kn(e){return e instanceof Ui}function Na(e){return Cr(e)&&/^( |\t|\r?\n)+$/.test(e.textContent||"")}function nu(e,t){return 16&t?"code":t&Lb?"mark":32&t?"sub":64&t?"sup":null}function ru(e,t){return 1&t?"strong":2&t?"em":"span"}function g1(e,t,n,r,o){const i=r.classList;let s=Ri(o,"base");s!==void 0&&i.add(...s),s=Ri(o,"underlineStrikethrough");let a=!1;const l=8&t&&4&t;s!==void 0&&(8&n&&4&n?(a=!0,l||i.add(...s)):l&&i.remove(...s));for(const c in Hr){const u=Hr[c];if(s=Ri(o,c),s!==void 0)if(n&u){if(a&&(c==="underline"||c==="strikethrough")){t&u&&i.remove(...s);continue}((t&u)===0||l&&c==="underline"||c==="strikethrough")&&i.add(...s)}else t&u&&i.remove(...s)}}function p1(e,t,n){const r=t.firstChild,o=n.isComposing(),i=e+(o?Zl:"");if(r==null)t.textContent=i;else{const s=r.nodeValue;if(s!==i)if(o||ko){const[a,l,c]=(function(u,f){const d=u.length,h=f.length;let g=0,p=0;for(;g<d&&g<h&&u[g]===f[g];)g++;for(;p+g<d&&p+g<h&&u[d-p-1]===f[h-p-1];)p++;return[g,d-g-p,f.slice(g,h-p)]})(s,i);l!==0&&r.deleteData(a,l),r.insertData(a,c)}else r.nodeValue=i}}function Tm(e,t,n,r,o,i){p1(o,e,t);const s=i.theme.text;s!==void 0&&g1(0,0,r,e,s)}function Ma(e,t){const n=document.createElement(t);return n.appendChild(e),n}class fn extends Wn{__text;__format;__style;__mode;__detail;static getType(){return"text"}static clone(t){return new fn(t.__text,t.__key)}afterCloneFrom(t){super.afterCloneFrom(t),this.__text=t.__text,this.__format=t.__format,this.__style=t.__style,this.__mode=t.__mode,this.__detail=t.__detail}constructor(t="",n){super(n),this.__text=t,this.__format=0,this.__style="",this.__mode=0,this.__detail=0}getFormat(){return this.getLatest().__format}getDetail(){return this.getLatest().__detail}getMode(){const t=this.getLatest();return T3[t.__mode]}getStyle(){return this.getLatest().__style}isToken(){return this.getLatest().__mode===1}isComposing(){return this.__key===Mr()}isSegmented(){return this.getLatest().__mode===2}isDirectionless(){return!!(1&this.getLatest().__detail)}isUnmergeable(){return!!(2&this.getLatest().__detail)}hasFormat(t){const n=Hr[t];return(this.getFormat()&n)!==0}isSimpleText(){return this.__type==="text"&&this.__mode===0}getTextContent(){return this.getLatest().__text}getFormatFlags(t,n){return Ml(this.getLatest().__format,t,n)}canHaveFormat(){return!0}isInline(){return!0}createDOM(t,n){const r=this.__format,o=nu(0,r),i=ru(0,r),s=o===null?i:o,a=document.createElement(s);let l=a;this.hasFormat("code")&&a.setAttribute("spellcheck","false"),o!==null&&(l=document.createElement(i),a.appendChild(l)),Tm(l,this,0,r,this.__text,t);const c=this.__style;return c!==""&&(a.style.cssText=c),a}updateDOM(t,n,r){const o=this.__text,i=t.__format,s=this.__format,a=nu(0,i),l=nu(0,s),c=ru(0,i),u=ru(0,s);if((a===null?c:a)!==(l===null?u:l))return!0;if(a===l&&c!==u){const p=n.firstChild;p==null&&Y(48);const m=document.createElement(u);return Tm(m,this,0,s,o,r),n.replaceChild(m,p),!1}let f=n;l!==null&&a!==null&&(f=n.firstChild,f==null&&Y(49)),p1(o,f,this);const d=r.theme.text;d!==void 0&&i!==s&&g1(0,i,s,f,d);const h=t.__style,g=this.__style;return h!==g&&(n.style.cssText=g),!1}static importDOM(){return{"#text":()=>({conversion:sA,priority:0}),b:()=>({conversion:oA,priority:0}),code:()=>({conversion:nr,priority:0}),em:()=>({conversion:nr,priority:0}),i:()=>({conversion:nr,priority:0}),mark:()=>({conversion:nr,priority:0}),s:()=>({conversion:nr,priority:0}),span:()=>({conversion:rA,priority:0}),strong:()=>({conversion:nr,priority:0}),sub:()=>({conversion:nr,priority:0}),sup:()=>({conversion:nr,priority:0}),u:()=>({conversion:nr,priority:0})}}static importJSON(t){return Fe().updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setTextContent(t.text).setFormat(t.format).setDetail(t.detail).setMode(t.mode).setStyle(t.style)}exportDOM(t){let{element:n}=super.exportDOM(t);return Be(n)||Y(132),n.style.whiteSpace="pre-wrap",this.hasFormat("lowercase")?n.style.textTransform="lowercase":this.hasFormat("uppercase")?n.style.textTransform="uppercase":this.hasFormat("capitalize")&&(n.style.textTransform="capitalize"),this.hasFormat("bold")&&(n=Ma(n,"b")),this.hasFormat("italic")&&(n=Ma(n,"i")),this.hasFormat("strikethrough")&&(n=Ma(n,"s")),this.hasFormat("underline")&&(n=Ma(n,"u")),{element:n}}exportJSON(){return{detail:this.getDetail(),format:this.getFormat(),mode:this.getMode(),style:this.getStyle(),text:this.getTextContent(),...super.exportJSON()}}selectionTransform(t,n){}setFormat(t){const n=this.getWritable();return n.__format=typeof t=="string"?Hr[t]:t,n}setDetail(t){const n=this.getWritable();return n.__detail=typeof t=="string"?C3[t]:t,n}setStyle(t){const n=this.getWritable();return n.__style=t,n}toggleFormat(t){const n=Ml(this.getFormat(),t,null);return this.setFormat(n)}toggleDirectionless(){const t=this.getWritable();return t.__detail^=1,t}toggleUnmergeable(){const t=this.getWritable();return t.__detail^=2,t}setMode(t){const n=_3[t];if(this.__mode===n)return this;const r=this.getWritable();return r.__mode=n,r}setTextContent(t){if(this.__text===t)return this;const n=this.getWritable();return n.__text=t,n}select(t,n){ft();let r=t,o=n;const i=X(),s=this.getTextContent(),a=this.__key;if(typeof s=="string"){const l=s.length;r===void 0&&(r=l),o===void 0&&(o=l)}else r=0,o=0;if(!W(i))return v1(a,r,a,o,"text","text");{const l=Mr();l!==i.anchor.key&&l!==i.focus.key||yt(a),i.setTextNodeRange(this,r,this,o)}return i}selectStart(){return this.select(0,0)}selectEnd(){const t=this.getTextContentSize();return this.select(t,t)}spliceText(t,n,r,o){const i=this.getWritable(),s=i.__text,a=r.length;let l=t;l<0&&(l=a+l,l<0&&(l=0));const c=X();if(o&&W(c)){const f=t+a;c.setTextNodeRange(i,f,i,f)}const u=s.slice(0,l)+r+s.slice(l+n);return i.__text=u,i}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...t){ft();const n=this.getLatest(),r=n.getTextContent();if(r==="")return[];const o=n.__key,i=Mr(),s=r.length;t.sort((R,k)=>R-k),t.push(s);const a=[],l=t.length;for(let R=0,k=0;R<s&&k<=l;k++){const M=t[k];M>R&&(a.push(r.slice(R,M)),R=M)}const c=a.length;if(c===1)return[n];const u=a[0],f=n.getParent();let d;const h=n.getFormat(),g=n.getStyle(),p=n.__detail;let m=!1,v=null,y=null;const x=X();if(W(x)){const[R,k]=x.isBackward()?[x.focus,x.anchor]:[x.anchor,x.focus];R.type==="text"&&R.key===o&&(v=R),k.type==="text"&&k.key===o&&(y=k)}n.isSegmented()?(d=Fe(u),d.__format=h,d.__style=g,d.__detail=p,d.__state=gm(n,d),m=!0):d=n.setTextContent(u);const b=[d];for(let R=1;R<c;R++){const k=Fe(a[R]);k.__format=h,k.__style=g,k.__detail=p,k.__state=gm(n,k);const M=k.__key;i===o&&yt(M),b.push(k)}const w=v?v.offset:null,_=y?y.offset:null;let E=0;for(const R of b){if(!v&&!y)break;const k=E+R.getTextContentSize();if(v!==null&&w!==null&&w<=k&&w>=E&&(v.set(R.getKey(),w-E,"text"),w<k&&(v=null)),y!==null&&_!==null&&_<=k&&_>=E){y.set(R.getKey(),_-E,"text");break}E=k}if(f!==null){(function(M){const F=M.getPreviousSibling(),D=M.getNextSibling();F!==null&&Pl(F),D!==null&&Pl(D)})(this);const R=f.getWritable(),k=this.getIndexWithinParent();m?(R.splice(k,0,b),this.remove()):R.splice(k,1,b),W(x)&&Al(x,f,k,c-1)}return b}mergeWithSibling(t){const n=t===this.getPreviousSibling();n||t===this.getNextSibling()||Y(50);const r=this.__key,o=t.__key,i=this.__text,s=i.length;Mr()===o&&yt(r);const a=X();if(W(a)){const f=a.anchor,d=a.focus;f!==null&&f.key===o&&$m(f,n,r,t,s),d!==null&&d.key===o&&$m(d,n,r,t,s)}const l=t.__text,c=n?l+i:i+l;this.setTextContent(c);const u=this.getWritable();return t.remove(),u}isTextEntity(){return!1}}function rA(e){return{forChild:Th(e.style),node:null}}function oA(e){const t=e,n=t.style.fontWeight==="normal";return{forChild:Th(t.style,n?void 0:"bold"),node:null}}const Em=new WeakMap;function iA(e){if(!Be(e))return!1;if(e.nodeName==="PRE")return!0;const t=e.style.whiteSpace;return typeof t=="string"&&t.startsWith("pre")}function sA(e){const t=e;e.parentElement===null&&Y(129);let n=t.textContent||"";if((function(r){let o,i=r.parentNode;const s=[r];for(;i!==null&&(o=Em.get(i))===void 0&&!iA(i);)s.push(i),i=i.parentNode;const a=o===void 0?i:o;for(let l=0;l<s.length;l++)Em.set(s[l],a);return a})(t)!==null){const r=n.split(/(\r?\n|\t)/),o=[],i=r.length;for(let s=0;s<i;s++){const a=r[s];a===`
40
40
  `||a===`\r
41
- `?o.push(Tn()):a===" "?o.push(Vi()):a!==""&&o.push(Fe(a))}return{node:o}}if(n=n.replace(/\r/g,"").replace(/[ \t\n]+/g," "),n==="")return{node:null};if(n[0]===" "){let r=t,o=!0;for(;r!==null&&(r=_m(r,!1))!==null;){const i=r.textContent||"";if(i.length>0){/[ \t\n]$/.test(i)&&(n=n.slice(1)),o=!1;break}}o&&(n=n.slice(1))}if(n[n.length-1]===" "){let r=t,o=!0;for(;r!==null&&(r=_m(r,!0))!==null;)if((r.textContent||"").replace(/^( |\t|\r?\n)+/,"").length>0){o=!1;break}o&&(n=n.slice(0,n.length-1))}return n===""?{node:null}:{node:Fe(n)}}function _m(e,t){let n=e;for(;;){let r;for(;(r=t?n.nextSibling:n.previousSibling)===null;){const i=n.parentElement;if(i===null)return null;n=i}if(n=r,Be(n)){const i=n.style.display;if(i===""&&!Kd(n)||i!==""&&!i.startsWith("inline"))return null}let o=n;for(;(o=t?n.firstChild:n.lastChild)!==null;)n=o;if(xr(n))return n;if(n.nodeName==="BR")return null}}const oA={code:"code",em:"italic",i:"italic",mark:"highlight",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function Qn(e){const t=oA[e.nodeName.toLowerCase()];return t===void 0?{node:null}:{forChild:yh(e.style,t),node:null}}function Fe(e=""){return _t(new un(e))}function X(e){return e instanceof un}function yh(e,t){const n=e.fontWeight,r=e.textDecoration.split(" "),o=n==="700"||n==="bold",i=r.includes("line-through"),s=e.fontStyle==="italic",a=r.includes("underline"),l=e.verticalAlign;return c=>(X(c)&&(o&&!c.hasFormat("bold")&&c.toggleFormat("bold"),i&&!c.hasFormat("strikethrough")&&c.toggleFormat("strikethrough"),s&&!c.hasFormat("italic")&&c.toggleFormat("italic"),a&&!c.hasFormat("underline")&&c.toggleFormat("underline"),l!=="sub"||c.hasFormat("subscript")||c.toggleFormat("subscript"),l!=="super"||c.hasFormat("superscript")||c.toggleFormat("superscript"),t&&!c.hasFormat(t)&&c.toggleFormat(t)),c)}class ji extends un{static getType(){return"tab"}static clone(t){return new ji(t.__key)}constructor(t){super(" ",t),this.__detail=2}static importDOM(){return null}createDOM(t){const n=super.createDOM(t),r=vi(t.theme,"tab");return r!==void 0&&n.classList.add(...r),n}static importJSON(t){return Vi().updateFromJSON(t)}setTextContent(t){return t!==" "&&t!==""&&T1(126),super.setTextContent(" ")}spliceText(t,n,r,o){return r===""&&n===0||r===" "&&n===1||q(286),this}setDetail(t){return t!==2&&q(127),this}setMode(t){return t!=="normal"&&q(128),this}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}}function Vi(){return _t(new ji)}function Yl(e){return e instanceof ji}class iA{key;offset;type;_selection;constructor(t,n,r){this._selection=null,this.key=t,this.offset=n,this.type=r}is(t){return this.key===t.key&&this.offset===t.offset&&this.type===t.type}isBefore(t){return this.key===t.key?this.offset<t.offset:Vb(Mt(En(this,"next")),Mt(En(t,"next")))<0}getNode(){const t=Le(this.key);return t===null&&q(20),t}set(t,n,r,o){const i=this._selection,s=this.key;o&&this.key===t&&this.offset===n&&this.type===r||(this.key=t,this.offset=n,this.type=r,Bi()||(kr()===s&&gt(t),i!==null&&(i.setCachedNodes(null),i.dirty=!0)))}}function zt(e,t,n){return new iA(e,t,n)}function Xc(e,t){let n=t.__key,r=e.offset,o="element";if(X(t)){o="text";const i=t.getTextContentSize();r>i&&(r=i)}else if(!B(t)){const i=t.getNextSibling();if(X(i))n=i.__key,r=0,o="text";else{const s=t.getParent();s&&(n=s.__key,r=t.getIndexWithinParent()+1)}}e.set(n,r,o)}function Tm(e,t){if(B(t)){const n=t.getLastDescendant();B(n)||X(n)?Xc(e,n):Xc(e,t)}else Xc(e,t)}class Xl{_nodes;_cachedNodes;dirty;constructor(t){this._cachedNodes=null,this._nodes=t,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(t){this._cachedNodes=t}is(t){if(!bt(t))return!1;const n=this._nodes,r=t._nodes;return n.size===r.size&&Array.from(n).every(o=>r.has(o))}isCollapsed(){return!1}isBackward(){return!1}getStartEndPoints(){return null}add(t){this.dirty=!0,this._nodes.add(t),this._cachedNodes=null}delete(t){this.dirty=!0,this._nodes.delete(t),this._cachedNodes=null}clear(){this.dirty=!0,this._nodes.clear(),this._cachedNodes=null}has(t){return this._nodes.has(t)}clone(){return new Xl(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(t){}insertText(){}insertNodes(t){const n=this.getNodes(),r=n.length,o=n[r-1];let i;if(X(o))i=o.select();else{const s=o.getIndexWithinParent()+1;i=o.getParentOrThrow().select(s,s)}i.insertNodes(t);for(let s=0;s<r;s++)n[s].remove()}getNodes(){const t=this._cachedNodes;if(t!==null)return t;const n=this._nodes,r=[];for(const o of n){const i=Le(o);i!==null&&r.push(i)}return Bi()||(this._cachedNodes=r),r}getTextContent(){const t=this.getNodes();let n="";for(let r=0;r<t.length;r++)n+=t[r].getTextContent();return n}deleteNodes(){const t=this.getNodes();if((Y()||qn())===this&&t[0]){const n=tt(t[0],"next");zb(Br(n,n))}for(const n of t)n.remove()}}function W(e){return e instanceof Oo}class Oo{format;style;anchor;focus;_cachedNodes;dirty;constructor(t,n,r,o){this.anchor=t,this.focus=n,t._selection=this,n._selection=this,this._cachedNodes=null,this.format=r,this.style=o,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(t){this._cachedNodes=t}is(t){return!!W(t)&&this.anchor.is(t.anchor)&&this.focus.is(t.focus)&&this.format===t.format&&this.style===t.style}isCollapsed(){return this.anchor.is(this.focus)}getNodes(){const t=this._cachedNodes;if(t!==null)return t;const n=(function(r){const o=[],[i,s]=r.getTextSlices();i&&o.push(i.caret.origin);const a=new Set,l=new Set;for(const c of r)if(jt(c)){const{origin:u}=c;o.length===0?a.add(u):(l.add(u),o.push(u))}else{const{origin:u}=c;B(u)&&l.has(u)||o.push(u)}if(s&&o.push(s.caret.origin),Vr(r.focus)&&B(r.focus.origin)&&r.focus.getNodeAtCaret()===null)for(let c=Nt(r.focus.origin,"previous");jt(c)&&a.has(c.origin)&&!c.origin.isEmpty()&&c.origin.is(o[o.length-1]);c=ta(c))a.delete(c.origin),o.pop();for(;o.length>1;){const c=o[o.length-1];if(!B(c)||l.has(c)||c.isEmpty()||a.has(c))break;o.pop()}if(o.length===0&&r.isCollapsed()){const c=Mt(r.anchor),u=Mt(r.anchor.getFlipped()),f=h=>Wn(h)?h.origin:h.getNodeAtCaret(),d=f(c)||f(u)||(r.anchor.getNodeAtCaret()?c.origin:u.origin);o.push(d)}return o})(Hb(Zm(this),"next"));return Bi()||(this._cachedNodes=n),n}setTextNodeRange(t,n,r,o){this.anchor.set(t.__key,n,"text"),this.focus.set(r.__key,o,"text")}getTextContent(){const t=this.getNodes();if(t.length===0)return"";const n=t[0],r=t[t.length-1],o=this.anchor,i=this.focus,s=o.isBefore(i),[a,l]=Dd(this);let c="",u=!0;for(let f=0;f<t.length;f++){const d=t[f];if(B(d)&&!d.isInline())u||(c+=`
42
- `),u=!d.isEmpty();else if(u=!1,X(d)){let h=d.getTextContent();d===n?d===r?o.type==="element"&&i.type==="element"&&i.offset!==o.offset||(h=a<l?h.slice(a,l):h.slice(l,a)):h=s?h.slice(a):h.slice(l):d===r&&(h=s?h.slice(0,l):h.slice(0,a)),c+=h}else!_e(d)&&!zn(d)||d===r&&this.isCollapsed()||(c+=d.getTextContent())}return c}applyDOMRange(t){const n=$e(),r=n.getEditorState()._selection,o=fb(t.startContainer,t.startOffset,t.endContainer,t.endOffset,n,r);if(o===null)return;const[i,s]=o;this.anchor.set(i.key,i.offset,i.type,!0),this.focus.set(s.key,s.offset,s.type,!0),Ls(this)}clone(){const t=this.anchor,n=this.focus;return new Oo(zt(t.key,t.offset,t.type),zt(n.key,n.offset,n.type),this.format,this.style)}toggleFormat(t){this.format=Sl(this.format,t,null),this.dirty=!0}setFormat(t){this.format=t,this.dirty=!0}setStyle(t){this.style=t,this.dirty=!0}hasFormat(t){const n=jr[t];return(this.format&n)!==0}insertRawText(t){const n=t.split(/(\r?\n|\t)/),r=[],o=n.length;for(let i=0;i<o;i++){const s=n[i];s===`
41
+ `?o.push(kn()):a===" "?o.push(qi()):a!==""&&o.push(Fe(a))}return{node:o}}if(n=n.replace(/\r/g,"").replace(/[ \t\n]+/g," "),n==="")return{node:null};if(n[0]===" "){let r=t,o=!0;for(;r!==null&&(r=Rm(r,!1))!==null;){const i=r.textContent||"";if(i.length>0){/[ \t\n]$/.test(i)&&(n=n.slice(1)),o=!1;break}}o&&(n=n.slice(1))}if(n[n.length-1]===" "){let r=t,o=!0;for(;r!==null&&(r=Rm(r,!0))!==null;)if((r.textContent||"").replace(/^( |\t|\r?\n)+/,"").length>0){o=!1;break}o&&(n=n.slice(0,n.length-1))}return n===""?{node:null}:{node:Fe(n)}}function Rm(e,t){let n=e;for(;;){let r;for(;(r=t?n.nextSibling:n.previousSibling)===null;){const i=n.parentElement;if(i===null)return null;n=i}if(n=r,Be(n)){const i=n.style.display;if(i===""&&!ef(n)||i!==""&&!i.startsWith("inline"))return null}let o=n;for(;(o=t?n.firstChild:n.lastChild)!==null;)n=o;if(Cr(n))return n;if(n.nodeName==="BR")return null}}const aA={code:"code",em:"italic",i:"italic",mark:"highlight",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function nr(e){const t=aA[e.nodeName.toLowerCase()];return t===void 0?{node:null}:{forChild:Th(e.style,t),node:null}}function Fe(e=""){return Et(new fn(e))}function J(e){return e instanceof fn}function Th(e,t){const n=e.fontWeight,r=e.textDecoration.split(" "),o=n==="700"||n==="bold",i=r.includes("line-through"),s=e.fontStyle==="italic",a=r.includes("underline"),l=e.verticalAlign;return c=>(J(c)&&(o&&!c.hasFormat("bold")&&c.toggleFormat("bold"),i&&!c.hasFormat("strikethrough")&&c.toggleFormat("strikethrough"),s&&!c.hasFormat("italic")&&c.toggleFormat("italic"),a&&!c.hasFormat("underline")&&c.toggleFormat("underline"),l!=="sub"||c.hasFormat("subscript")||c.toggleFormat("subscript"),l!=="super"||c.hasFormat("superscript")||c.toggleFormat("superscript"),t&&!c.hasFormat(t)&&c.toggleFormat(t)),c)}class Gi extends fn{static getType(){return"tab"}static clone(t){return new Gi(t.__key)}constructor(t){super(" ",t),this.__detail=2}static importDOM(){return null}createDOM(t){const n=super.createDOM(t),r=Ri(t.theme,"tab");return r!==void 0&&n.classList.add(...r),n}static importJSON(t){return qi().updateFromJSON(t)}setTextContent(t){return t!==" "&&t!==""&&Nb(126),super.setTextContent(" ")}spliceText(t,n,r,o){return r===""&&n===0||r===" "&&n===1||Y(286),this}setDetail(t){return t!==2&&Y(127),this}setMode(t){return t!=="normal"&&Y(128),this}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}}function qi(){return Et(new Gi)}function rc(e){return e instanceof Gi}class lA{key;offset;type;_selection;constructor(t,n,r){this._selection=null,this.key=t,this.offset=n,this.type=r}is(t){return this.key===t.key&&this.offset===t.offset&&this.type===t.type}isBefore(t){return this.key===t.key?this.offset<t.offset:K1(Lt(An(this,"next")),Lt(An(t,"next")))<0}getNode(){const t=Pe(this.key);return t===null&&Y(20),t}set(t,n,r,o){const i=this._selection,s=this.key;o&&this.key===t&&this.offset===n&&this.type===r||(this.key=t,this.offset=n,this.type=r,Yi()||(Mr()===s&&yt(t),i!==null&&(i.setCachedNodes(null),i.dirty=!0)))}}function Kt(e,t,n){return new lA(e,t,n)}function ou(e,t){let n=t.__key,r=e.offset,o="element";if(J(t)){o="text";const i=t.getTextContentSize();r>i&&(r=i)}else if(!B(t)){const i=t.getNextSibling();if(J(i))n=i.__key,r=0,o="text";else{const s=t.getParent();s&&(n=s.__key,r=t.getIndexWithinParent()+1)}}e.set(n,r,o)}function km(e,t){if(B(t)){const n=t.getLastDescendant();B(n)||J(n)?ou(e,n):ou(e,t)}else ou(e,t)}class oc{_nodes;_cachedNodes;dirty;constructor(t){this._cachedNodes=null,this._nodes=t,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(t){this._cachedNodes=t}is(t){if(!Ct(t))return!1;const n=this._nodes,r=t._nodes;return n.size===r.size&&Array.from(n).every(o=>r.has(o))}isCollapsed(){return!1}isBackward(){return!1}getStartEndPoints(){return null}add(t){this.dirty=!0,this._nodes.add(t),this._cachedNodes=null}delete(t){this.dirty=!0,this._nodes.delete(t),this._cachedNodes=null}clear(){this.dirty=!0,this._nodes.clear(),this._cachedNodes=null}has(t){return this._nodes.has(t)}clone(){return new oc(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(t){}insertText(){}insertNodes(t){const n=this.getNodes(),r=n.length,o=n[r-1];let i;if(J(o))i=o.select();else{const s=o.getIndexWithinParent()+1;i=o.getParentOrThrow().select(s,s)}i.insertNodes(t);for(let s=0;s<r;s++)n[s].remove()}getNodes(){const t=this._cachedNodes;if(t!==null)return t;const n=this._nodes,r=[];for(const o of n){const i=Pe(o);i!==null&&r.push(i)}return Yi()||(this._cachedNodes=r),r}getTextContent(){const t=this.getNodes();let n="";for(let r=0;r<t.length;r++)n+=t[r].getTextContent();return n}deleteNodes(){const t=this.getNodes();if((X()||Zn())===this&&t[0]){const n=nt(t[0],"next");G1(Kr(n,n))}for(const n of t)n.remove()}}function W(e){return e instanceof Ho}class Ho{format;style;anchor;focus;_cachedNodes;dirty;constructor(t,n,r,o){this.anchor=t,this.focus=n,t._selection=this,n._selection=this,this._cachedNodes=null,this.format=r,this.style=o,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(t){this._cachedNodes=t}is(t){return!!W(t)&&this.anchor.is(t.anchor)&&this.focus.is(t.focus)&&this.format===t.format&&this.style===t.style}isCollapsed(){return this.anchor.is(this.focus)}getNodes(){const t=this._cachedNodes;if(t!==null)return t;const n=(function(r){const o=[],[i,s]=r.getTextSlices();i&&o.push(i.caret.origin);const a=new Set,l=new Set;for(const c of r)if(zt(c)){const{origin:u}=c;o.length===0?a.add(u):(l.add(u),o.push(u))}else{const{origin:u}=c;B(u)&&l.has(u)||o.push(u)}if(s&&o.push(s.caret.origin),Wr(r.focus)&&B(r.focus.origin)&&r.focus.getNodeAtCaret()===null)for(let c=Ft(r.focus.origin,"previous");zt(c)&&a.has(c.origin)&&!c.origin.isEmpty()&&c.origin.is(o[o.length-1]);c=ca(c))a.delete(c.origin),o.pop();for(;o.length>1;){const c=o[o.length-1];if(!B(c)||l.has(c)||c.isEmpty()||a.has(c))break;o.pop()}if(o.length===0&&r.isCollapsed()){const c=Lt(r.anchor),u=Lt(r.anchor.getFlipped()),f=h=>Gn(h)?h.origin:h.getNodeAtCaret(),d=f(c)||f(u)||(r.anchor.getNodeAtCaret()?c.origin:u.origin);o.push(d)}return o})(q1(ey(this),"next"));return Yi()||(this._cachedNodes=n),n}setTextNodeRange(t,n,r,o){this.anchor.set(t.__key,n,"text"),this.focus.set(r.__key,o,"text")}getTextContent(){const t=this.getNodes();if(t.length===0)return"";const n=t[0],r=t[t.length-1],o=this.anchor,i=this.focus,s=o.isBefore(i),[a,l]=Gd(this);let c="",u=!0;for(let f=0;f<t.length;f++){const d=t[f];if(B(d)&&!d.isInline())u||(c+=`
42
+ `),u=!d.isEmpty();else if(u=!1,J(d)){let h=d.getTextContent();d===n?d===r?o.type==="element"&&i.type==="element"&&i.offset!==o.offset||(h=a<l?h.slice(a,l):h.slice(l,a)):h=s?h.slice(a):h.slice(l):d===r&&(h=s?h.slice(0,l):h.slice(0,a)),c+=h}else!Te(d)&&!Kn(d)||d===r&&this.isCollapsed()||(c+=d.getTextContent())}return c}applyDOMRange(t){const n=$e(),r=n.getEditorState()._selection,o=y1(t.startContainer,t.startOffset,t.endContainer,t.endOffset,n,r);if(o===null)return;const[i,s]=o;this.anchor.set(i.key,i.offset,i.type,!0),this.focus.set(s.key,s.offset,s.type,!0),Bs(this)}clone(){const t=this.anchor,n=this.focus;return new Ho(Kt(t.key,t.offset,t.type),Kt(n.key,n.offset,n.type),this.format,this.style)}toggleFormat(t){this.format=Ml(this.format,t,null),this.dirty=!0}setFormat(t){this.format=t,this.dirty=!0}setStyle(t){this.style=t,this.dirty=!0}hasFormat(t){const n=Hr[t];return(this.format&n)!==0}insertRawText(t){const n=t.split(/(\r?\n|\t)/),r=[],o=n.length;for(let i=0;i<o;i++){const s=n[i];s===`
43
43
  `||s===`\r
44
- `?r.push(Tn()):s===" "?r.push(Vi()):r.push(Fe(s))}this.insertNodes(r)}insertText(t){const n=this.anchor,r=this.focus,o=this.format,i=this.style;let s=n,a=r;!this.isCollapsed()&&r.isBefore(n)&&(s=r,a=n),s.type==="element"&&(function(m,x,y,v){const b=m.getNode(),w=b.getChildAtIndex(m.offset),_=Fe();if(_.setFormat(y),_.setStyle(v),Yr(w))w.splice(0,0,[_]);else{const E=ot(b)?ye().append(_):_;w===null?b.append(E):w.insertBefore(E)}m.is(x)&&x.set(_.__key,0,"text"),m.set(_.__key,0,"text")})(s,a,o,i),a.type==="element"&&bn(a,Mt(En(a,"next")));const l=s.offset;let c=a.offset;const u=this.getNodes(),f=u.length;let d=u[0];X(d)||q(26);const h=d.getTextContent().length,g=d.getParentOrThrow();let p=u[f-1];if(f===1&&a.type==="element"&&(c=h,a.set(s.key,c,"text")),this.isCollapsed()&&l===h&&(rr(d)||!d.canInsertTextAfter()||!g.canInsertTextAfter()&&d.getNextSibling()===null)){let m=d.getNextSibling();if(X(m)&&m.canInsertTextBefore()&&!rr(m)||(m=Fe(),m.setFormat(o),m.setStyle(i),g.canInsertTextAfter()?d.insertAfter(m):g.insertAfter(m)),m.select(0,0),d=m,t!=="")return void this.insertText(t)}else if(this.isCollapsed()&&l===0&&(rr(d)||!d.canInsertTextBefore()||!g.canInsertTextBefore()&&d.getPreviousSibling()===null)){let m=d.getPreviousSibling();if(X(m)&&!rr(m)||(m=Fe(),m.setFormat(o),g.canInsertTextBefore()?d.insertBefore(m):g.insertBefore(m)),m.select(),d=m,t!=="")return void this.insertText(t)}else if(d.isSegmented()&&l!==h){const m=Fe(d.getTextContent());m.setFormat(o),d.replace(m),d=m}else if(!this.isCollapsed()&&t!==""){const m=p.getParent();if(!g.canInsertTextBefore()||!g.canInsertTextAfter()||B(m)&&(!m.canInsertTextBefore()||!m.canInsertTextAfter()))return this.insertText(""),db(this.anchor,this.focus,null),void this.insertText(t)}if(f===1){if(xo(d)){const v=Fe(t);return v.select(),void d.replace(v)}const m=d.getFormat(),x=d.getStyle();if(l!==c||m===o&&x===i){if(Yl(d)){const v=Fe(t);return v.setFormat(o),v.setStyle(i),v.select(),void d.replace(v)}}else{if(d.getTextContent()!==""){const v=Fe(t);if(v.setFormat(o),v.setStyle(i),v.select(),l===0)d.insertBefore(v,!1);else{const[b]=d.splitText(l);b.insertAfter(v,!1)}return void(v.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=t.length))}d.setFormat(o),d.setStyle(i)}const y=c-l;d=d.spliceText(l,y,t,!0),d.getTextContent()===""?d.remove():this.anchor.type==="text"&&(d.isComposing()?this.anchor.offset-=t.length:(this.format=m,this.style=x))}else{const m=new Set([...d.getParentKeys(),...p.getParentKeys()]),x=B(d)?d:d.getParentOrThrow();let y=B(p)?p:p.getParentOrThrow(),v=p;if(!x.is(y)&&y.isInline())do v=y,y=y.getParentOrThrow();while(y.isInline());if(a.type==="text"&&(c!==0||p.getTextContent()==="")||a.type==="element"&&p.getIndexWithinParent()<c)if(X(p)&&!xo(p)&&c!==p.getTextContentSize()){if(p.isSegmented()){const T=Fe(p.getTextContent());p.replace(T),p=T}ot(a.getNode())||a.type!=="text"||(p=p.spliceText(0,c,"")),m.add(p.__key)}else{const T=p.getParentOrThrow();T.canBeEmpty()||T.getChildrenSize()!==1?p.remove():T.remove()}else m.add(p.__key);const b=y.getChildren(),w=new Set(u),_=x.is(y),E=x.isInline()&&d.getNextSibling()===null?x:d;for(let T=b.length-1;T>=0;T--){const k=b[T];if(k.is(d)||B(k)&&k.isParentOf(d))break;k.isAttached()&&(!w.has(k)||k.is(v)?_||E.insertAfter(k,!1):k.remove())}if(!_){let T=y,k=null;for(;T!==null;){const P=T.getChildren(),O=P.length;(O===0||P[O-1].is(k))&&(m.delete(T.__key),k=T),T=T.getParent()}}if(xo(d))if(l===h)d.select();else{const T=Fe(t);T.select(),d.replace(T)}else d=d.spliceText(l,h-l,t,!0),d.getTextContent()===""?d.remove():d.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=t.length);for(let T=1;T<f;T++){const k=u[T],P=k.__key;m.has(P)||k.remove()}}}removeText(){const t=Y()===this;Ja(this,DA(Zm(this))),t&&Y()!==this&&Ge(this)}formatText(t,n=null){if(this.isCollapsed())return this.toggleFormat(t),void gt(null);const r=this.getNodes(),o=[];for(const b of r)X(b)&&o.push(b);const i=b=>{r.forEach(w=>{if(B(w)){const _=w.getFormatFlags(t,b);w.setTextFormat(_)}})},s=o.length;if(s===0)return this.toggleFormat(t),gt(null),void i(n);const a=this.anchor,l=this.focus,c=this.isBackward(),u=c?l:a,f=c?a:l;let d=0,h=o[0],g=u.type==="element"?0:u.offset;if(u.type==="text"&&g===h.getTextContentSize()&&(d=1,h=o[1],g=0),h==null)return;const p=h.getFormatFlags(t,n);i(p);const m=s-1;let x=o[m];const y=f.type==="text"?f.offset:x.getTextContentSize();if(h.is(x)){if(g===y)return;if(rr(h)||g===0&&y===h.getTextContentSize())h.setFormat(p);else{const b=h.splitText(g,y),w=g===0?b[0]:b[1];w.setFormat(p),u.type==="text"&&u.set(w.__key,0,"text"),f.type==="text"&&f.set(w.__key,y-g,"text")}return void(this.format=p)}g===0||rr(h)||([,h]=h.splitText(g),g=0),h.setFormat(p);const v=x.getFormatFlags(t,p);y>0&&(y===x.getTextContentSize()||rr(x)||([x]=x.splitText(y)),x.setFormat(v));for(let b=d+1;b<m;b++){const w=o[b],_=w.getFormatFlags(t,v);w.setFormat(_)}u.type==="text"&&u.set(h.__key,g,"text"),f.type==="text"&&f.set(x.__key,y,"text"),this.format=p|v}insertNodes(t){if(t.length===0)return;if(this.isCollapsed()||this.removeText(),this.anchor.key==="root"){this.insertParagraph();const g=Y();return W(g)||q(134),g.insertNodes(t)}const n=(this.isBackward()?this.focus:this.anchor).getNode(),r=we(n,Rr),o=t[t.length-1];if(B(r)&&"__language"in r){if("__language"in t[0])this.insertText(t[0].getTextContent());else{const g=Zc(this);r.splice(g,0,t),o.selectEnd()}return}if(!t.some(g=>(B(g)||_e(g))&&!g.isInline())){B(r)||q(211,n.constructor.name,n.getType());const g=Zc(this);return r.splice(g,0,t),void o.selectEnd()}const i=(function(g){const p=ye();let m=null;for(let x=0;x<g.length;x++){const y=g[x],v=zn(y);if(v||_e(y)&&y.isInline()||B(y)&&y.isInline()||X(y)||y.isParentRequired()){if(m===null&&(m=y.createParentElementNode(),p.append(m),v))continue;m!==null&&m.append(y)}else p.append(y),m=null}return p})(t),s=i.getLastDescendant(),a=i.getChildren(),l=!B(r)||!r.isEmpty()?this.insertParagraph():null,c=a[a.length-1];let u=a[0];var f;B(f=u)&&Rr(f)&&!f.isEmpty()&&B(r)&&(!r.isEmpty()||r.canMergeWhenEmpty())&&(B(r)||q(211,n.constructor.name,n.getType()),r.append(...u.getChildren()),u=a[1]),u&&(r===null&&q(212,n.constructor.name,n.getType()),(function(g,p){const m=p.getParentOrThrow().getLastChild();let x=p;const y=[p];for(;x!==m;)x.getNextSibling()||q(140),x=x.getNextSibling(),y.push(x);let v=g;for(const b of y)v=v.insertAfter(b)})(r,u));const d=we(s,Rr);l&&B(d)&&(l.canMergeWhenEmpty()||Rr(c))&&(d.append(...l.getChildren()),l.remove()),B(r)&&r.isEmpty()&&r.remove(),s.selectEnd();const h=B(r)?r.getLastChild():null;zn(h)&&d!==r&&h.remove()}insertParagraph(){if(this.anchor.key==="root"){const s=ye();return qe().splice(this.anchor.offset,0,[s]),s.select(),s}const t=Zc(this),n=we(this.anchor.getNode(),Rr);B(n)||q(213);const r=n.getChildAtIndex(t),o=r?[r,...r.getNextSiblings()]:[],i=n.insertNewAfter(this,!1);return i?(i.append(...o),i.selectStart(),i):null}insertLineBreak(t){const n=Tn();if(this.insertNodes([n]),t){const r=n.getParentOrThrow(),o=n.getIndexWithinParent();r.select(o,o)}}extract(){const t=[...this.getNodes()],n=t.length;let r=t[0],o=t[n-1];const[i,s]=Dd(this),a=this.isBackward(),[l,c]=a?[this.focus,this.anchor]:[this.anchor,this.focus],[u,f]=a?[s,i]:[i,s];if(n===0)return[];if(n===1){if(X(r)&&!this.isCollapsed()){const d=r.splitText(u,f),h=u===0?d[0]:d[1];return h?(l.set(h.getKey(),0,"text"),c.set(h.getKey(),h.getTextContentSize(),"text"),[h]):[]}return[r]}if(X(r)&&(u===r.getTextContentSize()?t.shift():u!==0&&([,r]=r.splitText(u),t[0]=r,l.set(r.getKey(),0,"text"))),X(o)){const d=o.getTextContent().length;f===0?t.pop():f!==d&&([o]=o.splitText(f),t[t.length-1]=o,c.set(o.getKey(),o.getTextContentSize(),"text"))}return t}modify(t,n,r){if(Lm(this,t,n,r))return;const o=t==="move",i=$e(),s=Lt(dn(i));if(!s)return;const a=i._blockCursorElement,l=i._rootElement,c=this.focus.getNode();if(l===null||a===null||!B(c)||c.isInline()||c.canBeEmpty()||Hd(a,i,l),this.dirty){let u=Eo(i,this.anchor.key),f=Eo(i,this.focus.key);this.anchor.type==="text"&&(u=Ai(u)),this.focus.type==="text"&&(f=Ai(f)),u&&f&&gb(s,u,this.anchor.offset,f,this.focus.offset)}if((function(u,f,d,h){u.modify(f,d,h)})(s,t,n?"backward":"forward",r),s.rangeCount>0){const u=s.getRangeAt(0),f=this.anchor.getNode(),d=ot(f)?f:SA(f);if(this.applyDOMRange(u),this.dirty=!0,!o){const h=this.getNodes(),g=[];let p=!1;for(let m=0;m<h.length;m++){const x=h[m];zd(x,d)?g.push(x):p=!0}if(p&&g.length>0)if(n){const m=g[0];B(m)?m.selectStart():m.getParentOrThrow().selectStart()}else{const m=g[g.length-1];B(m)?m.selectEnd():m.getParentOrThrow().selectEnd()}s.anchorNode===u.startContainer&&s.anchorOffset===u.startOffset||(function(m){const x=m.focus,y=m.anchor,v=y.key,b=y.offset,w=y.type;y.set(x.key,x.offset,x.type,!0),x.set(v,b,w,!0)})(this)}}r==="lineboundary"&&Lm(this,t,n,r,"decorators")}forwardDeletion(t,n,r){if(!r&&(t.type==="element"&&B(n)&&t.offset===n.getChildrenSize()||t.type==="text"&&t.offset===n.getTextContentSize())){const o=n.getParent(),i=n.getNextSibling()||(o===null?null:o.getNextSibling());if(B(i)&&i.isShadowRoot())return!0}return!1}deleteCharacter(t){const n=this.isCollapsed();if(this.isCollapsed()){const r=this.anchor;let o=r.getNode();if(this.forwardDeletion(r,o,t))return;const i=Ds(En(r,t?"previous":"next"));if(i.getTextSlices().every(a=>a===null||a.distance===0)){let a={type:"initial"};for(const l of i.iterNodeCarets("shadowRoot"))if(jt(l)){if(!l.origin.isInline()){if(l.origin.isShadowRoot()){if(a.type==="merge-block")break;if(B(i.anchor.origin)&&i.anchor.origin.isEmpty()){const c=Mt(l);Ja(this,Br(c,c)),i.anchor.origin.remove()}return}a.type!=="merge-next-block"&&a.type!=="merge-block"||(a={block:a.block,caret:l,type:"merge-block"})}}else{if(a.type==="merge-block")break;if(Vr(l)){if(B(l.origin)){if(l.origin.isInline()){if(!l.origin.isParentOf(i.anchor.origin))break}else a={block:l.origin,type:"merge-next-block"};continue}if(_e(l.origin)){if(!l.origin.isIsolated())if(a.type==="merge-next-block"&&(l.origin.isKeyboardSelectable()||!l.origin.isInline())&&B(i.anchor.origin)&&i.anchor.origin.isEmpty()){i.anchor.origin.remove();const c=vh();c.add(l.origin.getKey()),Ge(c)}else l.origin.remove();return}break}}if(a.type==="merge-block"){const{caret:l,block:c}=a;return Ja(this,Br(!l.origin.isEmpty()&&c.isEmpty()?na(tt(c,l.direction)):i.anchor,l)),this.removeText()}}const s=this.focus;if(this.modify("extend",t,"character"),this.isCollapsed()){if(t&&r.offset===0&&Rm(this,r.getNode()))return}else{const a=s.type==="text"?s.getNode():null;if(o=r.type==="text"?r.getNode():null,a!==null&&a.isSegmented()){const l=s.offset,c=a.getTextContentSize();if(a.is(o)||t&&l!==c||!t&&l!==0)return void km(a,t,l)}else if(o!==null&&o.isSegmented()){const l=r.offset,c=o.getTextContentSize();if(o.is(a)||t&&l!==0||!t&&l!==c)return void km(o,t,l)}(function(l,c){const u=l.anchor,f=l.focus,d=u.getNode(),h=f.getNode();if(d===h&&u.type==="text"&&f.type==="text"){const g=u.offset,p=f.offset,m=g<p,x=m?g:p,y=m?p:g,v=y-1;x!==v&&(function(b){return!(Nb(b)||sA(b))})(d.getTextContent().slice(x,y))&&(c?f.set(f.key,v,f.type):u.set(u.key,v,u.type))}})(this,t)}}if(this.removeText(),t&&!n&&this.isCollapsed()&&this.anchor.type==="element"&&this.anchor.offset===0){const r=this.anchor.getNode();r.isEmpty()&&ot(r.getParent())&&r.getPreviousSibling()===null&&Rm(this,r)}}deleteLine(t){this.isCollapsed()&&this.modify("extend",t,"lineboundary"),this.isCollapsed()?this.deleteCharacter(t):this.removeText()}deleteWord(t){if(this.isCollapsed()){const n=this.anchor,r=n.getNode();if(this.forwardDeletion(n,r,t))return;this.modify("extend",t,"word")}this.removeText()}isBackward(){return this.focus.isBefore(this.anchor)}getStartEndPoints(){return[this.anchor,this.focus]}}function bt(e){return e instanceof Xl}function Em(e){const t=e.offset;if(e.type==="text")return t;const n=e.getNode();return t===n.getChildrenSize()?n.getTextContent().length:0}function Dd(e){const t=e.getStartEndPoints();if(t===null)return[0,0];const[n,r]=t;return n.type==="element"&&r.type==="element"&&n.key===r.key&&n.offset===r.offset?[0,0]:[Em(n),Em(r)]}function Rm(e,t){for(let n=t;n;n=n.getParent()){if(B(n)){if(n.collapseAtStart(e))return!0;if(pt(n))break}if(n.getPreviousSibling())break}return!1}const sA=(()=>{try{const e=new RegExp("\\p{Emoji}","u"),t=e.test.bind(e);if(t("❤️")&&t("#️⃣")&&t("👍"))return t}catch{}return()=>!1})();function km(e,t,n){const r=e,o=r.getTextContent().split(/(?=\s)/g),i=o.length;let s=0,a=0;for(let c=0;c<i;c++){const u=c===i-1;if(a=s,s+=o[c].length,t&&s===n||s>n||u){o.splice(c,1),u&&(a=void 0);break}}const l=o.join("").trim();l===""?r.remove():(r.setTextContent(l),r.select(a,a))}function Am(e,t,n,r){let o,i=t;if(Be(e)){let s=!1;const a=e.childNodes,l=a.length,c=r._blockCursorElement;i===l&&(s=!0,i=l-1);let u=a[i],f=!1;if(u===c)u=a[i+1],f=!0;else if(c!==null){const d=c.parentNode;e===d&&t>Array.prototype.indexOf.call(d.children,c)&&i--}if(o=fi(u),X(o))i=Kn(o,s?"next":"previous");else{let d=fi(e);if(d===null)return null;if(B(d)){const h=r.getElementByKey(d.getKey());h===null&&q(214),[d,i]=d.getDOMSlot(h).resolveChildIndex(d,h,e,t),B(d)||q(215),s&&i>=d.getChildrenSize()&&(i=Math.max(0,d.getChildrenSize()-1));let p=d.getChildAtIndex(i);if(B(p)&&(function(m,x,y){const v=m.getParent();return y===null||v===null||!v.canBeEmpty()||v!==y.getNode()})(p,0,n)){const m=s?p.getLastDescendant():p.getFirstDescendant();m===null?d=p:(p=m,d=B(p)?p:p.getParentOrThrow()),i=0}X(p)?(o=p,d=null,i=Kn(p,s?"next":"previous")):p!==d&&s&&!f&&(B(d)||q(216),i=Math.min(d.getChildrenSize(),i+1))}else{const h=d.getIndexWithinParent();i=t===0&&_e(d)&&fi(e)===d?h:h+1,d=d.getParentOrThrow()}if(B(d))return zt(d.__key,i,"element")}}else o=fi(e);return X(o)?zt(o.__key,Kn(o,i,"clamp"),"text"):null}function Mm(e,t,n){const r=e.offset,o=e.getNode();if(r===0){const i=o.getPreviousSibling(),s=o.getParent();if(t){if((n||!t)&&i===null&&B(s)&&s.isInline()){const a=s.getPreviousSibling();X(a)&&e.set(a.__key,a.getTextContent().length,"text")}}else B(i)&&!n&&i.isInline()?e.set(i.__key,i.getChildrenSize(),"element"):X(i)&&e.set(i.__key,i.getTextContent().length,"text")}else if(r===o.getTextContent().length){const i=o.getNextSibling(),s=o.getParent();if(t&&B(i)&&i.isInline())e.set(i.__key,0,"element");else if((n||t)&&i===null&&B(s)&&s.isInline()&&!s.canInsertTextAfter()){const a=s.getNextSibling();X(a)&&e.set(a.__key,0,"text")}}}function db(e,t,n){if(e.type==="text"&&t.type==="text"){const r=e.isBefore(t),o=e.is(t);Mm(e,r,o),Mm(t,!r,o),o&&t.set(e.key,e.offset,e.type);const i=$e();if(i.isComposing()&&i._compositionKey!==e.key&&W(n)){const s=n.anchor,a=n.focus;e.set(s.key,s.offset,s.type,!0),t.set(a.key,a.offset,a.type,!0)}}}function fb(e,t,n,r,o,i){if(e===null||n===null||!Qs(o,e,n))return null;const s=Am(e,t,W(i)?i.anchor:null,o);if(s===null)return null;const a=Am(n,r,W(i)?i.focus:null,o);if(a===null)return null;if(s.type==="element"&&a.type==="element"){const l=fi(e),c=fi(n);if(_e(l)&&_e(c))return null}return db(s,a,i),[s,a]}function jd(e){return B(e)&&!e.isInline()}function hb(e,t,n,r,o,i){const s=qr(),a=new Oo(zt(e,t,o),zt(n,r,i),0,"");return a.dirty=!0,s._selection=a,a}function Zl(){const e=zt("root",0,"element"),t=zt("root",0,"element");return new Oo(e,t,0,"")}function vh(){return new Xl(new Set)}function aA(e,t){return Jl(null,e,t,null)}function Jl(e,t,n,r){const o=n._window;if(o===null)return null;const i=r||o.event,s=i?i.type:void 0,a=s==="selectionchange",l=!wd&&(a||s==="beforeinput"||s==="compositionstart"||s==="compositionend"||s==="click"&&i&&i.detail===3||s==="drop"||s===void 0);let c,u,f,d;if(W(e)&&!l)return e.clone();if(t===null)return null;if(c=t.anchorNode,u=t.focusNode,f=t.anchorOffset,d=t.focusOffset,(a||s===void 0)&&W(e)&&!Qs(n,c,u))return e.clone();const h=fb(c,f,u,d,n,e);if(h===null)return null;const[g,p]=h;return new Oo(g,p,W(e)?e.format:0,W(e)?e.style:"")}function Y(){return qr()._selection}function qn(){return $e()._editorState._selection}function wl(e,t,n,r=1){const o=e.anchor,i=e.focus,s=o.getNode(),a=i.getNode();if(!t.is(s)&&!t.is(a))return;const l=t.__key;if(e.isCollapsed()){const c=o.offset;if(n<=c&&r>0||n<c&&r<0){const u=Math.max(0,c+r);o.set(l,u,"element"),i.set(l,u,"element"),Nm(e)}}else{const c=e.isBackward(),u=c?i:o,f=u.getNode(),d=c?o:i,h=d.getNode();if(t.is(f)){const g=u.offset;(n<=g&&r>0||n<g&&r<0)&&u.set(l,Math.max(0,g+r),"element")}if(t.is(h)){const g=d.offset;(n<=g&&r>0||n<g&&r<0)&&d.set(l,Math.max(0,g+r),"element")}}Nm(e)}function Nm(e){const t=e.anchor,n=t.offset,r=e.focus,o=r.offset,i=t.getNode(),s=r.getNode();if(e.isCollapsed()){if(!B(i))return;const a=i.getChildrenSize(),l=n>=a,c=l?i.getChildAtIndex(a-1):i.getChildAtIndex(n);if(X(c)){let u=0;l&&(u=c.getTextContentSize()),t.set(c.__key,u,"text"),r.set(c.__key,u,"text")}return}if(B(i)){const a=i.getChildrenSize(),l=n>=a,c=l?i.getChildAtIndex(a-1):i.getChildAtIndex(n);if(X(c)){let u=0;l&&(u=c.getTextContentSize()),t.set(c.__key,u,"text")}}if(B(s)){const a=s.getChildrenSize(),l=o>=a,c=l?s.getChildAtIndex(a-1):s.getChildAtIndex(o);if(X(c)){let u=0;l&&(u=c.getTextContentSize()),r.set(c.__key,u,"text")}}}function Cl(e,t,n,r,o){let i=null,s=0,a=null;r!==null?(i=r.__key,X(r)?(s=r.getTextContentSize(),a="text"):B(r)&&(s=r.getChildrenSize(),a="element")):o!==null&&(i=o.__key,X(o)?a="text":B(o)&&(a="element")),i!==null&&a!==null?e.set(i,s,a):(s=t.getIndexWithinParent(),s===-1&&(s=n.getChildrenSize()),e.set(n.__key,s,"element"))}function Pm(e,t,n,r,o){e.type==="text"?e.set(n,e.offset+(t?0:o),"text"):e.offset>r.getIndexWithinParent()&&e.set(e.key,e.offset-1,"element")}function gb(e,t,n,r,o){try{e.setBaseAndExtent(t,n,r,o)}catch{}}function lA(e,t,n,r,o,i,s){const a=r.anchorNode,l=r.focusNode,c=r.anchorOffset,u=r.focusOffset,f=document.activeElement;if(o.has(lb)&&f!==i||f!==null&&Th(f))return;if(!W(t))return void(e!==null&&Qs(n,a,l)&&r.removeAllRanges());const d=t.anchor,h=t.focus,g=d.key,p=h.key,m=Eo(n,g),x=Eo(n,p),y=d.offset,v=h.offset,b=t.format,w=t.style,_=t.isCollapsed();let E=m,T=x,k=!1;if(d.type==="text"){E=Ai(m);const H=d.getNode();k=H.getFormat()!==b||H.getStyle()!==w}else W(e)&&e.anchor.type==="text"&&(k=!0);var P,O,D,I,$;if(h.type==="text"&&(T=Ai(x)),E!==null&&T!==null&&(_&&(e===null||k||W(e)&&(e.format!==b||e.style!==w))&&(P=b,O=w,D=y,I=g,$=performance.now(),tb=[P,O,D,I,$]),c!==y||u!==v||a!==E||l!==T||r.type==="Range"&&_||(f!==null&&i.contains(f)||o.has(J3)||i.focus({preventScroll:!0}),d.type==="element"))){if(gb(r,E,y,T,v),!o.has(X3)&&t.isCollapsed()&&i!==null&&i===document.activeElement){const H=W(t)&&t.anchor.type==="element"?E.childNodes[y]||null:r.rangeCount>0?r.getRangeAt(0):null;if(H!==null){let U;if(H instanceof Text){const L=document.createRange();L.selectNode(H),U=L.getBoundingClientRect()}else U=H.getBoundingClientRect();(function(L,N,V){const K=$b(V),te=Nh(K);if(K===null||te===null)return;let{top:J,bottom:Z}=N,ae=0,oe=0,fe=V;for(;fe!==null;){const Te=fe===K.body;if(Te)ae=0,oe=dn(L).innerHeight;else{const ve=fe.getBoundingClientRect();ae=ve.top,oe=ve.bottom}let ne=0;if(J<ae?ne=-(ae-J):Z>oe&&(ne=Z-oe),ne!==0)if(Te)te.scrollBy(0,ne);else{const ve=fe.scrollTop;fe.scrollTop+=ne;const Ee=fe.scrollTop-ve;J-=Ee,Z-=Ee}if(Te)break;fe=ea(fe)}})(n,U,i)}}Ld=!0}}function xh(e){let t=Y()||qn();t===null&&(t=qe().selectEnd()),t.insertNodes(e)}function Zc(e){let t=e;e.isCollapsed()||t.removeText();const n=Y();W(n)&&(t=n),W(t)||q(161);const r=t.anchor;let o=r.getNode(),i=r.offset;for(;!Rr(o);){const s=o;if([o,i]=cA(o,i),s.is(o))break}return i}function cA(e,t){const n=e.getParent();if(!n){const o=ye();return qe().append(o),o.select(),[qe(),0]}if(X(e)){const o=e.splitText(t);if(o.length===0)return[n,e.getIndexWithinParent()];const i=t===0?0:1;return[n,o[0].getIndexWithinParent()+i]}if(!B(e)||t===0)return[n,e.getIndexWithinParent()];const r=e.getChildAtIndex(t);if(r){const o=new Oo(zt(e.__key,t,"element"),zt(e.__key,t,"element"),0,""),i=e.insertNewAfter(o);i&&i.append(r,...r.getNextSiblings())}return[n,e.getIndexWithinParent()+1]}function Lm(e,t,n,r,o="decorators-and-blocks"){if(t==="move"&&r==="character"&&!e.isCollapsed()){const[u,f]=n===e.isBackward()?[e.focus,e.anchor]:[e.anchor,e.focus];return f.set(u.key,u.offset,u.type),!0}const i=En(e.focus,n?"previous":"next"),s=r==="lineboundary",a=t==="move";let l=i,c=o==="decorators-and-blocks";if(!Ih(l)){for(const u of l){c=!1;const{origin:f}=u;if(!_e(f)||f.isIsolated()||(l=u,!s||!f.isInline()))break}if(c)for(const u of Ds(i).iterNodeCarets(t==="extend"?"shadowRoot":"root")){if(jt(u))u.origin.isInline()||(l=u);else{if(B(u.origin))continue;_e(u.origin)&&!u.origin.isInline()&&(l=u)}break}}if(l===i)return!1;if(a&&!s&&_e(l.origin)&&l.origin.isKeyboardSelectable()){const u=vh();return u.add(l.origin.getKey()),Ge(u),!0}return l=Mt(l),a&&bn(e.anchor,l),bn(e.focus,l),c||!s}let dt=null,ft=null,Dt=!1,Jc=!1,Xa=0;const Fm={characterData:!0,childList:!0,subtree:!0};function Bi(){return Dt||dt!==null&&dt._readOnly}function ut(){Dt&&q(13)}function pb(){Xa>99&&q(14)}function qr(){return dt===null&&q(195,mb()),dt}function $e(){return ft===null&&q(196,mb()),ft}function mb(){let e=0;const t=new Set,n=ki.version;if(typeof window<"u")for(const o of document.querySelectorAll("[contenteditable]")){const i=ec(o);if(Eh(i))e++;else if(i){let s=String(i.constructor.version||"<0.17.1");s===n&&(s+=" (separately built, likely a bundler configuration issue)"),t.add(s)}}let r=` Detected on the page: ${e} compatible editor(s) with version ${n}`;return t.size&&(r+=` and incompatible editors with versions ${Array.from(t).join(", ")}`),r}function uA(){return ft}function $m(e,t,n){const r=t.__type,o=Cb(e,r);let i=n.get(r);i===void 0&&(i=Array.from(o.transforms),n.set(r,i));const s=i.length;for(let a=0;a<s&&(i[a](t),t.isAttached());a++);}function Om(e,t){return e!==void 0&&e.__key!==t&&e.isAttached()}function yb(e,t){if(!t)return;const n=e._updateTags;let r=t;Array.isArray(t)||(r=[t]);for(const o of r)n.add(o)}function dA(e){return bh(e,$e()._nodes)}function bh(e,t){const n=e.type,r=t.get(n);r===void 0&&q(17,n);const o=r.klass;e.type!==o.getType()&&q(18,o.name);const i=o.importJSON(e),s=e.children;if(B(i)&&Array.isArray(s))for(let a=0;a<s.length;a++){const l=bh(s[a],t);i.append(l)}return i}function Im(e,t,n){const r=dt,o=Dt,i=ft;dt=t,Dt=!0,ft=e;try{return n()}finally{dt=r,Dt=o,ft=i}}function sr(e,t){const n=e._pendingEditorState,r=e._rootElement,o=e._headless||r===null;if(n===null)return;const i=e._editorState,s=i._selection,a=n._selection,l=e._dirtyType!==0,c=dt,u=Dt,f=ft,d=e._updating,h=e._observer;let g=null;if(e._pendingEditorState=null,e._editorState=n,!o&&l&&h!==null){ft=e,dt=n,Dt=!1,e._updating=!0;try{const _=e._dirtyType,E=e._dirtyElements,T=e._dirtyLeaves;h.disconnect(),g=F3(i,n,e,_,E,T)}catch(_){if(_ instanceof Error&&e._onError(_),Jc)throw _;return bb(e,null,r,n),P1(e),e._dirtyType=2,Jc=!0,sr(e,i),void(Jc=!1)}finally{h.observe(r,Fm),e._updating=d,dt=c,Dt=u,ft=f}}n._readOnly||(n._readOnly=!0);const p=e._dirtyLeaves,m=e._dirtyElements,x=e._normalizedNodes,y=e._updateTags,v=e._deferred;l&&(e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements=new Map,e._normalizedNodes=new Set,e._updateTags=new Set),(function(_,E){const T=_._decorators;let k=_._pendingDecorators||T;const P=E._nodeMap;let O;for(O in k)P.has(O)||(k===T&&(k=Ab(_)),delete k[O])})(e,n);const b=o?null:Lt(dn(e));if(e._editable&&b!==null&&(l||a===null||a.dirty||!a.is(s))&&r!==null&&!y.has(Z3)){ft=e,dt=n;try{if(h!==null&&h.disconnect(),l||a===null||a.dirty){const _=e._blockCursorElement;_!==null&&Hd(_,e,r),lA(s,a,e,b,y,r)}(function(_,E,T){let k=_._blockCursorElement;if(W(T)&&T.isCollapsed()&&T.anchor.type==="element"&&E.contains(document.activeElement)){const P=T.anchor,O=P.getNode(),D=P.offset;let I=!1,$=null;if(D===O.getChildrenSize())eu(O.getChildAtIndex(D-1))&&(I=!0);else{const H=O.getChildAtIndex(D);if(H!==null&&eu(H)){const U=H.getPreviousSibling();(U===null||eu(U))&&(I=!0,$=_.getElementByKey(H.__key))}}if(I){const H=_.getElementByKey(O.__key);return k===null&&(_._blockCursorElement=k=(function(U){const L=U.theme,N=document.createElement("div");N.contentEditable="false",N.setAttribute("data-lexical-cursor","true");let V=L.blockCursor;if(V!==void 0){if(typeof V=="string"){const K=R1(V);V=L.blockCursor=K}V!==void 0&&N.classList.add(...V)}return N})(_._config)),E.style.caretColor="transparent",void($===null?H.appendChild(k):H.insertBefore(k,$))}}k!==null&&Hd(k,_,E)})(e,r,a)}finally{h!==null&&h.observe(r,Fm),ft=f,dt=c}}g!==null&&(function(_,E,T,k,P){const O=Array.from(_._listeners.mutation),D=O.length;for(let I=0;I<D;I++){const[$,H]=O[I];for(const U of H){const L=E.get(U);L!==void 0&&$(L,{dirtyLeaves:k,prevEditorState:P,updateTags:T})}}})(e,g,y,p,i),W(a)||a===null||s!==null&&s.is(a)||e.dispatchCommand(cr,void 0);const w=e._pendingDecorators;w!==null&&(e._decorators=w,e._pendingDecorators=null,ws("decorator",e,!0,w)),(function(_,E,T){const k=Bm(E),P=Bm(T);k!==P&&ws("textcontent",_,!0,P)})(e,t||i,n),ws("update",e,!0,{dirtyElements:m,dirtyLeaves:p,editorState:n,mutatedNodes:g,normalizedNodes:x,prevEditorState:t||i,tags:y}),(function(_,E){if(_._deferred=[],E.length!==0){const T=_._updating;_._updating=!0;try{for(let k=0;k<E.length;k++)E[k]()}finally{_._updating=T}}})(e,v),(function(_){const E=_._updates;if(E.length!==0){const T=E.shift();if(T){const[k,P]=T;Ql(_,k,P)}}})(e)}function ws(e,t,n,...r){const o=t._updating;t._updating=n;try{const i=Array.from(t._listeners[e]);for(let s=0;s<i.length;s++)i[s].apply(null,r)}finally{t._updating=o}}function Dm(e,t){const n=e._updates;let r=t||!1;for(;n.length!==0;){const o=n.shift();if(o){const[i,s]=o,a=e._pendingEditorState;let l;s!==void 0&&(l=s.onUpdate,s.skipTransforms&&(r=!0),s.discrete&&(a===null&&q(191),a._flushSync=!0),l&&e._deferred.push(l),yb(e,s.tag)),a==null?Ql(e,i,s):i()}}return r}function Ql(e,t,n){const r=e._updateTags;let o,i=!1,s=!1;n!==void 0&&(o=n.onUpdate,yb(e,n.tag),i=n.skipTransforms||!1,s=n.discrete||!1),o&&e._deferred.push(o);const a=e._editorState;let l=e._pendingEditorState,c=!1;(l===null||l._readOnly)&&(l=e._pendingEditorState=vb(l||a),c=!0),l._flushSync=s;const u=dt,f=Dt,d=ft,h=e._updating;dt=l,Dt=!1,e._updating=!0,ft=e;const g=e._headless||e.getRootElement()===null;Sh(null);try{c&&(g?a._selection!==null&&(l._selection=a._selection.clone()):l._selection=(function(y,v){const b=y.getEditorState()._selection,w=Lt(dn(y));return W(b)||b==null?Jl(b,w,y,v):b.clone()})(e,n&&n.event||null));const m=e._compositionKey;t(),i=Dm(e,i),(function(y,v){const b=v.getEditorState()._selection,w=y._selection;if(W(w)){const _=w.anchor,E=w.focus;let T;if(_.type==="text"&&(T=_.getNode(),T.selectionTransform(b,w)),E.type==="text"){const k=E.getNode();T!==k&&k.selectionTransform(b,w)}}})(l,e),e._dirtyType!==0&&(i?(function(y,v){const b=v._dirtyLeaves,w=y._nodeMap;for(const _ of b){const E=w.get(_);X(E)&&E.isAttached()&&E.isSimpleText()&&!E.isUnmergeable()&&gm(E)}})(l,e):(function(y,v){const b=v._dirtyLeaves,w=v._dirtyElements,_=y._nodeMap,E=kr(),T=new Map;let k=b,P=k.size,O=w,D=O.size;for(;P>0||D>0;){if(P>0){v._dirtyLeaves=new Set;for(const I of k){const $=_.get(I);X($)&&$.isAttached()&&$.isSimpleText()&&!$.isUnmergeable()&&gm($),$!==void 0&&Om($,E)&&$m(v,$,T),b.add(I)}if(k=v._dirtyLeaves,P=k.size,P>0){Xa++;continue}}v._dirtyLeaves=new Set,v._dirtyElements=new Map,O.delete("root")&&O.set("root",!0);for(const I of O){const $=I[0],H=I[1];if(w.set($,H),!H)continue;const U=_.get($);U!==void 0&&Om(U,E)&&$m(v,U,T)}k=v._dirtyLeaves,P=k.size,O=v._dirtyElements,D=O.size,Xa++}v._dirtyLeaves=b,v._dirtyElements=w})(l,e),Dm(e),(function(y,v,b,w){const _=y._nodeMap,E=v._nodeMap,T=[];for(const[k]of w){const P=E.get(k);P!==void 0&&(P.isAttached()||(B(P)&&A1(P,k,_,E,T,w),_.has(k)||w.delete(k),T.push(k)))}for(const k of T)E.delete(k);for(const k of b){const P=E.get(k);P===void 0||P.isAttached()||(_.has(k)||b.delete(k),E.delete(k))}})(a,l,e._dirtyLeaves,e._dirtyElements)),m!==e._compositionKey&&(l._flushSync=!0);const x=l._selection;if(W(x)){const y=l._nodeMap,v=x.anchor.key,b=x.focus.key;y.get(v)!==void 0&&y.get(b)!==void 0||q(19)}else bt(x)&&x._nodes.size===0&&(l._selection=null)}catch(m){return m instanceof Error&&e._onError(m),e._pendingEditorState=a,e._dirtyType=2,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),void sr(e)}finally{dt=u,Dt=f,ft=d,e._updating=h,Xa=0}e._dirtyType!==0||e._deferred.length>0||(function(m,x){const y=x.getEditorState()._selection,v=m._selection;if(v!==null){if(v.dirty||!v.is(y))return!0}else if(y!==null)return!0;return!1})(l,e)?l._flushSync?(l._flushSync=!1,sr(e)):c&&yA(()=>{sr(e)}):(l._flushSync=!1,c&&(r.clear(),e._deferred=[],e._pendingEditorState=null))}function Hn(e,t,n){ft===e&&n===void 0?t():Ql(e,t,n)}class Cs{element;before;after;constructor(t,n,r){this.element=t,this.before=n||null,this.after=r||null}withBefore(t){return new Cs(this.element,t,this.after)}withAfter(t){return new Cs(this.element,this.before,t)}withElement(t){return this.element===t?this:new Cs(t,this.before,this.after)}insertChild(t){const n=this.before||this.getManagedLineBreak();return n!==null&&n.parentElement!==this.element&&q(222),this.element.insertBefore(t,n),this}removeChild(t){return t.parentElement!==this.element&&q(223),this.element.removeChild(t),this}replaceChild(t,n){return n.parentElement!==this.element&&q(224),this.element.replaceChild(t,n),this}getFirstChild(){const t=this.after?this.after.nextSibling:this.element.firstChild;return t===this.before||t===this.getManagedLineBreak()?null:t}getManagedLineBreak(){return this.element.__lexicalLineBreak||null}setManagedLineBreak(t){if(t===null)this.removeManagedLineBreak();else{const n=t==="decorator"&&(Xs||Ii||Ys);this.insertManagedLineBreak(n)}}removeManagedLineBreak(){const t=this.getManagedLineBreak();if(t){const n=this.element,r=t.nodeName==="IMG"?t.nextSibling:null;r&&n.removeChild(r),n.removeChild(t),n.__lexicalLineBreak=void 0}}insertManagedLineBreak(t){const n=this.getManagedLineBreak();if(n){if(t===(n.nodeName==="IMG"))return;this.removeManagedLineBreak()}const r=this.element,o=this.before,i=document.createElement("br");if(r.insertBefore(i,o),t){const s=document.createElement("img");s.setAttribute("data-lexical-linebreak","true"),s.style.cssText="display: inline !important; border: 0px !important; margin: 0px !important;",s.alt="",r.insertBefore(s,i),r.__lexicalLineBreak=s}else r.__lexicalLineBreak=i}getFirstChildOffset(){let t=0;for(let n=this.after;n!==null;n=n.previousSibling)t++;return t}resolveChildIndex(t,n,r,o){if(r===this.element){const l=this.getFirstChildOffset();return[t,Math.min(l+t.getChildrenSize(),Math.max(l,o))]}const i=jm(n,r);i.push(o);const s=jm(n,this.element);let a=t.getIndexWithinParent();for(let l=0;l<s.length;l++){const c=i[l],u=s[l];if(c===void 0||c<u)break;if(c>u){a+=1;break}}return[t.getParentOrThrow(),a]}}function jm(e,t){const n=[];let r=t;for(;r!==e&&r!==null;r=r.parentNode){let o=0;for(let i=r.previousSibling;i!==null;i=i.previousSibling)o++;n.push(o)}return r!==e&&q(225),n.reverse()}class St extends Bn{__first;__last;__size;__format;__style;__indent;__dir;__textFormat;__textStyle;constructor(t){super(t),this.__first=null,this.__last=null,this.__size=0,this.__format=0,this.__style="",this.__indent=0,this.__dir=null,this.__textFormat=0,this.__textStyle=""}afterCloneFrom(t){super.afterCloneFrom(t),this.__key===t.__key&&(this.__first=t.__first,this.__last=t.__last,this.__size=t.__size),this.__indent=t.__indent,this.__format=t.__format,this.__style=t.__style,this.__dir=t.__dir,this.__textFormat=t.__textFormat,this.__textStyle=t.__textStyle}getFormat(){return this.getLatest().__format}getFormatType(){const t=this.getFormat();return b3[t]||""}getStyle(){return this.getLatest().__style}getIndent(){return this.getLatest().__indent}getChildren(){const t=[];let n=this.getFirstChild();for(;n!==null;)t.push(n),n=n.getNextSibling();return t}getChildrenKeys(){const t=[];let n=this.getFirstChild();for(;n!==null;)t.push(n.__key),n=n.getNextSibling();return t}getChildrenSize(){return this.getLatest().__size}isEmpty(){return this.getChildrenSize()===0}isDirty(){const t=$e()._dirtyElements;return t!==null&&t.has(this.__key)}isLastChild(){const t=this.getLatest(),n=this.getParentOrThrow().getLastChild();return n!==null&&n.is(t)}getAllTextNodes(){const t=[];let n=this.getFirstChild();for(;n!==null;){if(X(n)&&t.push(n),B(n)){const r=n.getAllTextNodes();t.push(...r)}n=n.getNextSibling()}return t}getFirstDescendant(){let t=this.getFirstChild();for(;B(t);){const n=t.getFirstChild();if(n===null)break;t=n}return t}getLastDescendant(){let t=this.getLastChild();for(;B(t);){const n=t.getLastChild();if(n===null)break;t=n}return t}getDescendantByIndex(t){const n=this.getChildren(),r=n.length;if(t>=r){const i=n[r-1];return B(i)&&i.getLastDescendant()||i||null}const o=n[t];return B(o)&&o.getFirstDescendant()||o||null}getFirstChild(){const t=this.getLatest().__first;return t===null?null:Le(t)}getFirstChildOrThrow(){const t=this.getFirstChild();return t===null&&q(45,this.__key),t}getLastChild(){const t=this.getLatest().__last;return t===null?null:Le(t)}getLastChildOrThrow(){const t=this.getLastChild();return t===null&&q(96,this.__key),t}getChildAtIndex(t){const n=this.getChildrenSize();let r,o;if(t<n/2){for(r=this.getFirstChild(),o=0;r!==null&&o<=t;){if(o===t)return r;r=r.getNextSibling(),o++}return null}for(r=this.getLastChild(),o=n-1;r!==null&&o>=t;){if(o===t)return r;r=r.getPreviousSibling(),o--}return null}getTextContent(){let t="";const n=this.getChildren(),r=n.length;for(let o=0;o<r;o++){const i=n[o];t+=i.getTextContent(),B(i)&&o!==r-1&&!i.isInline()&&(t+=Dr)}return t}getTextContentSize(){let t=0;const n=this.getChildren(),r=n.length;for(let o=0;o<r;o++){const i=n[o];t+=i.getTextContentSize(),B(i)&&o!==r-1&&!i.isInline()&&(t+=2)}return t}getDirection(){return this.getLatest().__dir}getTextFormat(){return this.getLatest().__textFormat}hasFormat(t){if(t!==""){const n=sm[t];return(this.getFormat()&n)!==0}return!1}hasTextFormat(t){const n=jr[t];return(this.getTextFormat()&n)!==0}getFormatFlags(t,n){return Sl(this.getLatest().__textFormat,t,n)}getTextStyle(){return this.getLatest().__textStyle}select(t,n){ut();const r=Y();let o=t,i=n;const s=this.getChildrenSize();if(!this.canBeEmpty()){if(t===0&&n===0){const l=this.getFirstChild();if(X(l)||B(l))return l.select(0,0)}else if(!(t!==void 0&&t!==s||n!==void 0&&n!==s)){const l=this.getLastChild();if(X(l)||B(l))return l.select()}}o===void 0&&(o=s),i===void 0&&(i=s);const a=this.__key;return W(r)?(r.anchor.set(a,o,"element"),r.focus.set(a,i,"element"),r.dirty=!0,r):hb(a,o,a,i,"element","element")}selectStart(){const t=this.getFirstDescendant();return t?t.selectStart():this.select()}selectEnd(){const t=this.getLastDescendant();return t?t.selectEnd():this.select()}clear(){const t=this.getWritable();return this.getChildren().forEach(n=>n.remove()),t}append(...t){return this.splice(this.getChildrenSize(),0,t)}setDirection(t){const n=this.getWritable();return n.__dir=t,n}setFormat(t){return this.getWritable().__format=t!==""?sm[t]:0,this}setStyle(t){return this.getWritable().__style=t||"",this}setTextFormat(t){const n=this.getWritable();return n.__textFormat=t,n}setTextStyle(t){const n=this.getWritable();return n.__textStyle=t,n}setIndent(t){return this.getWritable().__indent=t,this}splice(t,n,r){bl(this)&&q(324,this.__key,this.__type);const o=this.getChildrenSize(),i=this.getWritable();t+n<=o||q(226,String(t),String(n),String(o));const s=i.__key,a=[],l=[],c=this.getChildAtIndex(t+n);let u=null,f=o-n+r.length;if(t!==0)if(t===o)u=this.getLastChild();else{const h=this.getChildAtIndex(t);h!==null&&(u=h.getPreviousSibling())}if(n>0){let h=u===null?this.getFirstChild():u.getNextSibling();for(let g=0;g<n;g++){h===null&&q(100);const p=h.getNextSibling(),m=h.__key;bo(h.getWritable()),l.push(m),h=p}}let d=u;for(const h of r){d!==null&&h.is(d)&&(u=d=d.getPreviousSibling());const g=h.getWritable();g.__parent===s&&f--,bo(g);const p=h.__key;if(d===null)i.__first=p,g.__prev=null;else{const m=d.getWritable();m.__next=p,g.__prev=m.__key}h.__key===s&&q(76),g.__parent=s,a.push(p),d=h}if(t+n===o)d!==null&&(d.getWritable().__next=null,i.__last=d.__key);else if(c!==null){const h=c.getWritable();if(d!==null){const g=d.getWritable();h.__prev=d.__key,g.__next=c.__key}else h.__prev=null}if(i.__size=f,l.length){const h=Y();if(W(h)){const g=new Set(l),p=new Set(a),{anchor:m,focus:x}=h;Vm(m,g,p)&&Cl(m,m.getNode(),this,u,c),Vm(x,g,p)&&Cl(x,x.getNode(),this,u,c),f!==0||this.canBeEmpty()||pt(this)||this.remove()}}return i}getDOMSlot(t){return new Cs(t)}exportDOM(t){const{element:n}=super.exportDOM(t);if(Be(n)){const r=this.getIndent();r>0&&(n.style.paddingInlineStart=40*r+"px");const o=this.getDirection();o&&(n.dir=o)}return{element:n}}exportJSON(){const t={children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),...super.exportJSON()},n=this.getTextFormat(),r=this.getTextStyle();return n===0&&r===""||pt(this)||this.getChildren().some(X)||(n!==0&&(t.textFormat=n),r!==""&&(t.textStyle=r)),t}updateFromJSON(t){return super.updateFromJSON(t).setFormat(t.format).setIndent(t.indent).setDirection(t.direction).setTextFormat(t.textFormat||0).setTextStyle(t.textStyle||"")}insertNewAfter(t,n){return null}canIndent(){return!0}collapseAtStart(t){return!1}excludeFromCopy(t){return!1}canReplaceWith(t){return!0}canInsertAfter(t){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(t){return!1}extractWithChild(t,n,r){return!1}canMergeWhenEmpty(){return!1}reconcileObservedMutation(t,n){const r=this.getDOMSlot(t);let o=r.getFirstChild();for(let i=this.getFirstChild();i;i=i.getNextSibling()){const s=n.getElementByKey(i.getKey());s!==null&&(o==null?(r.insertChild(s),o=s):o!==s&&r.replaceChild(s,o),o=o.nextSibling)}}}function B(e){return e instanceof St}function Vm(e,t,n){let r=e.getNode();for(;r;){const o=r.__key;if(t.has(o)&&!n.has(o))return!0;r=r.getParent()}return!1}class Zs extends Bn{decorate(t,n){return null}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function _e(e){return e instanceof Zs}class zi extends St{__cachedText;static getType(){return"root"}static clone(){return new zi}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){q(51)}getTextContent(){const t=this.__cachedText;return!Bi()&&$e()._dirtyType!==0||t===null?super.getTextContent():t}remove(){q(52)}replace(t){q(53)}insertBefore(t){q(54)}insertAfter(t){q(55)}updateDOM(t,n){return!1}splice(t,n,r){for(const o of r)B(o)||_e(o)||q(282);return super.splice(t,n,r)}static importJSON(t){return qe().updateFromJSON(t)}collapseAtStart(){return!0}}function ot(e){return e instanceof zi}function vb(e){return new Js(new Map(e._nodeMap))}function wh(){return new Js(new Map([["root",new zi]]))}function xb(e){const t=e.exportJSON(),n=e.constructor;if(t.type!==n.getType()&&q(130,n.name),B(e)){const r=t.children;Array.isArray(r)||q(59,n.name);const o=e.getChildren();for(let i=0;i<o.length;i++){const s=xb(o[i]);r.push(s)}}return t}function fA(e){return e instanceof Js}class Js{_nodeMap;_selection;_flushSync;_readOnly;constructor(t,n){this._nodeMap=t,this._selection=n||null,this._flushSync=!1,this._readOnly=!1}isEmpty(){return this._nodeMap.size===1&&this._selection===null}read(t,n){return Im(n&&n.editor||null,this,t)}clone(t){const n=new Js(this._nodeMap,t===void 0?this._selection:t);return n._readOnly=!0,n}toJSON(){return Im(null,this,()=>({root:xb(qe())}))}}class Ch extends St{static getType(){return"artificial"}createDOM(t){return document.createElement("div")}}class Io extends St{static getType(){return"paragraph"}static clone(t){return new Io(t.__key)}createDOM(t){const n=document.createElement("p"),r=vi(t.theme,"paragraph");return r!==void 0&&n.classList.add(...r),n}updateDOM(t,n,r){return!1}static importDOM(){return{p:t=>({conversion:hA,priority:0})}}exportDOM(t){const{element:n}=super.exportDOM(t);if(Be(n)){this.isEmpty()&&n.append(document.createElement("br"));const r=this.getFormatType();r&&(n.style.textAlign=r)}return{element:n}}static importJSON(t){return ye().updateFromJSON(t)}exportJSON(){const t=super.exportJSON();if(t.textFormat===void 0||t.textStyle===void 0){const n=this.getChildren().find(X);n?(t.textFormat=n.getFormat(),t.textStyle=n.getStyle()):(t.textFormat=this.getTextFormat(),t.textStyle=this.getTextStyle())}return t}insertNewAfter(t,n){const r=ye();r.setTextFormat(t.format),r.setTextStyle(t.style);const o=this.getDirection();return r.setDirection(o),r.setFormat(this.getFormatType()),r.setStyle(this.getStyle()),this.insertAfter(r,n),r}collapseAtStart(){const t=this.getChildren();if(t.length===0||X(t[0])&&t[0].getTextContent().trim()===""){if(this.getNextSibling()!==null)return this.selectNext(),this.remove(),!0;if(this.getPreviousSibling()!==null)return this.selectPrevious(),this.remove(),!0}return!1}}function hA(e){const t=ye();return e.style&&(t.setFormat(e.style.textAlign),Ph(e,t)),{node:t}}function ye(){return _t(new Io)}function Yr(e){return e instanceof Io}const be=0,ar=1,$t=3,gA=4;function bb(e,t,n,r){const o=e._keyToDOMMap;o.clear(),e._editorState=wh(),e._pendingEditorState=r,e._compositionKey=null,e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),e._normalizedNodes=new Set,e._updateTags=new Set,e._updates=[],e._blockCursorElement=null;const i=e._observer;i!==null&&(i.disconnect(),e._observer=null),t!==null&&(t.textContent=""),n!==null&&(n.textContent="",o.set("root",n))}function pA(e){const t=new Set,n=new Set;let r=e;for(;r;){const{ownNodeConfig:o}=rc(r),i=r.transform;if(!n.has(i)){n.add(i);const s=r.transform();s&&t.add(s)}if(o){const s=o.$transform;s&&t.add(s),r=o.extends}else{const s=Object.getPrototypeOf(r);r=s.prototype instanceof Bn&&s!==Bn?s:void 0}}return t}function wb(e){const t=e||{},n=uA(),r=t.theme||{},o=e===void 0?n:t.parentEditor||null,i=t.disableEvents||!1,s=wh(),a=t.namespace||(o!==null?o._config.namespace:Pb()),l=t.editorState,c=[zi,un,Di,ji,Io,Ch,...t.nodes||[]],{onError:u,html:f}=t,d=t.editable===void 0||t.editable;let h;if(e===void 0&&n!==null)h=n._nodes;else{h=new Map;for(let p=0;p<c.length;p++){let m=c[p],x=null,y=null;if(typeof m!="function"){const w=m;m=w.replace,x=w.with,y=w.withKlass||null}rc(m);const v=m.getType(),b=pA(m);h.set(v,{exportDOM:f&&f.export?f.export.get(m):void 0,klass:m,replace:x,replaceWithKlass:y,sharedNodeState:A3(c[p]),transforms:b})}}const g=new ki(s,o,h,{disableEvents:i,namespace:a,theme:r},u||console.error,(function(p,m){const x=new Map,y=new Set,v=b=>{Object.keys(b).forEach(w=>{let _=x.get(w);_===void 0&&(_=[],x.set(w,_)),_.push(b[w])})};return p.forEach(b=>{const w=b.klass.importDOM;if(w==null||y.has(w))return;y.add(w);const _=w.call(b.klass);_!==null&&v(_)}),m&&v(m),x})(h,f?f.import:void 0),d,e);return l!==void 0&&(g._pendingEditorState=l,g._dirtyType=2),(function(p){p.registerCommand(B1,z3,be),p.registerCommand(z1,H3,be),p.registerCommand(H1,W3,be),p.registerCommand(W1,K3,be),p.registerCommand(G1,U3,be)})(g),g}class ki{static version;_headless;_parentEditor;_rootElement;_editorState;_pendingEditorState;_compositionKey;_deferred;_keyToDOMMap;_updates;_updating;_listeners;_commands;_nodes;_decorators;_pendingDecorators;_config;_dirtyType;_cloneNotNeeded;_dirtyLeaves;_dirtyElements;_normalizedNodes;_updateTags;_observer;_key;_onError;_htmlConversions;_window;_editable;_blockCursorElement;_createEditorArgs;constructor(t,n,r,o,i,s,a,l){this._createEditorArgs=l,this._parentEditor=n,this._rootElement=null,this._editorState=t,this._pendingEditorState=null,this._compositionKey=null,this._deferred=[],this._keyToDOMMap=new Map,this._updates=[],this._updating=!1,this._listeners={decorator:new Set,editable:new Set,mutation:new Map,root:new Set,textcontent:new Set,update:new Set},this._commands=new Map,this._config=o,this._nodes=r,this._decorators={},this._pendingDecorators=null,this._dirtyType=0,this._cloneNotNeeded=new Set,this._dirtyLeaves=new Set,this._dirtyElements=new Map,this._normalizedNodes=new Set,this._updateTags=new Set,this._observer=null,this._key=Pb(),this._onError=i,this._htmlConversions=s,this._editable=a,this._headless=n!==null&&n._headless,this._window=null,this._blockCursorElement=null}isComposing(){return this._compositionKey!=null}registerUpdateListener(t){const n=this._listeners.update;return n.add(t),()=>{n.delete(t)}}registerEditableListener(t){const n=this._listeners.editable;return n.add(t),()=>{n.delete(t)}}registerDecoratorListener(t){const n=this._listeners.decorator;return n.add(t),()=>{n.delete(t)}}registerTextContentListener(t){const n=this._listeners.textcontent;return n.add(t),()=>{n.delete(t)}}registerRootListener(t){const n=this._listeners.root;return t(this._rootElement,null),n.add(t),()=>{t(null,this._rootElement),n.delete(t)}}registerCommand(t,n,r){r===void 0&&q(35);const o=this._commands;o.has(t)||o.set(t,[new Set,new Set,new Set,new Set,new Set]);const i=o.get(t);i===void 0&&q(36,String(t));const s=i[r];return s.add(n),()=>{s.delete(n),i.every(a=>a.size===0)&&o.delete(t)}}registerMutationListener(t,n,r){const o=this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(t)).klass,i=this._listeners.mutation;let s=i.get(n);s===void 0&&(s=new Set,i.set(n,s)),s.add(o);const a=r&&r.skipInitialization;return a!==void 0&&a||this.initializeMutationListener(n,o),()=>{s.delete(o),s.size===0&&i.delete(n)}}getRegisteredNode(t){const n=this._nodes.get(t.getType());return n===void 0&&q(37,t.name),n}resolveRegisteredNodeAfterReplacements(t){for(;t.replaceWithKlass;)t=this.getRegisteredNode(t.replaceWithKlass);return t}initializeMutationListener(t,n){const r=this._editorState,o=qm(r).get(n.getType());if(!o)return;const i=new Map;for(const s of o.keys())i.set(s,"created");i.size>0&&t(i,{dirtyLeaves:new Set,prevEditorState:r,updateTags:new Set(["registerMutationListener"])})}registerNodeTransformToKlass(t,n){const r=this.getRegisteredNode(t);return r.transforms.add(n),r}registerNodeTransform(t,n){const r=this.registerNodeTransformToKlass(t,n),o=[r],i=r.replaceWithKlass;if(i!=null){const s=this.registerNodeTransformToKlass(i,n);o.push(s)}return(function(s,a){const l=qm(s.getEditorState()),c=[];for(const u of a){const f=l.get(u);f&&c.push(f)}c.length!==0&&s.update(()=>{for(const u of c)for(const f of u.keys()){const d=Le(f);d&&d.markDirty()}},s._pendingEditorState===null?{tag:yi}:void 0)})(this,o.map(s=>s.klass.getType())),()=>{o.forEach(s=>s.transforms.delete(n))}}hasNode(t){return this._nodes.has(t.getType())}hasNodes(t){return t.every(this.hasNode.bind(this))}dispatchCommand(t,n){return Q(this,t,n)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(t){const n=this._rootElement;if(t!==n){const r=vi(this._config.theme,"root"),o=this._pendingEditorState||this._editorState;if(this._rootElement=t,bb(this,n,t,o),n!==null&&(this._config.disableEvents||G3(n),r!=null&&n.classList.remove(...r)),t!==null){const i=Nh(t),s=t.style;s.userSelect="text",s.whiteSpace="pre-wrap",s.wordBreak="break-word",t.setAttribute("data-lexical-editor","true"),this._window=i,this._dirtyType=2,P1(this),this._updateTags.add(yi),sr(this),this._config.disableEvents||(function(a,l){const c=a.ownerDocument;Pd.set(a,c);const u=vl.get(c)??0;u<1&&c.addEventListener("selectionchange",sb),vl.set(c,u+1),a.__lexicalEditor=l;const f=ib(a);for(let d=0;d<Nd.length;d++){const[h,g]=Nd[d],p=typeof g=="function"?m=>{wm(m)||(bm(m),(l.isEditable()||h==="click")&&g(m,l))}:m=>{if(wm(m))return;bm(m);const x=l.isEditable();switch(h){case"cut":return x&&Q(l,ql,m);case"copy":return Q(l,Gl,m);case"paste":return x&&Q(l,ch,m);case"dragstart":return x&&Q(l,X1,m);case"dragover":return x&&Q(l,Z1,m);case"dragend":return x&&Q(l,j3,m);case"focus":return x&&Q(l,J1,m);case"blur":return x&&Q(l,V3,m);case"drop":return x&&Q(l,Y1,m)}};a.addEventListener(h,p),f.push(()=>{a.removeEventListener(h,p)})}})(t,this),r!=null&&t.classList.add(...r)}else this._window=null,this._updateTags.add(yi),sr(this);ws("root",this,!1,t,n)}}getElementByKey(t){return this._keyToDOMMap.get(t)||null}getEditorState(){return this._editorState}setEditorState(t,n){t.isEmpty()&&q(38);let r=t;r._readOnly&&(r=vb(t),r._selection=t._selection?t._selection.clone():null),N1(this);const o=this._pendingEditorState,i=this._updateTags,s=n!==void 0?n.tag:null;o===null||o.isEmpty()||(s!=null&&i.add(s),sr(this)),this._pendingEditorState=r,this._dirtyType=2,this._dirtyElements.set("root",!1),this._compositionKey=null,s!=null&&i.add(s),this._updating||sr(this)}parseEditorState(t,n){return(function(r,o,i){const s=wh(),a=dt,l=Dt,c=ft,u=o._dirtyElements,f=o._dirtyLeaves,d=o._cloneNotNeeded,h=o._dirtyType;o._dirtyElements=new Map,o._dirtyLeaves=new Set,o._cloneNotNeeded=new Set,o._dirtyType=0,dt=s,Dt=!1,ft=o,Sh(null);try{const g=o._nodes;bh(r.root,g),i&&i(),s._readOnly=!0}catch(g){g instanceof Error&&o._onError(g)}finally{o._dirtyElements=u,o._dirtyLeaves=f,o._cloneNotNeeded=d,o._dirtyType=h,dt=a,Dt=l,ft=c}return s})(typeof t=="string"?JSON.parse(t):t,this,n)}read(t){return sr(this),this.getEditorState().read(t,{editor:this})}update(t,n){(function(r,o,i){r._updating?r._updates.push([o,i]):Ql(r,o,i)})(this,t,n)}focus(t,n={}){const r=this._rootElement;r!==null&&(r.setAttribute("autocapitalize","off"),Hn(this,()=>{const o=Y(),i=qe();o!==null?o.dirty||Ge(o.clone()):i.getChildrenSize()!==0&&(n.defaultSelection==="rootStart"?i.selectStart():i.selectEnd()),bA("focus"),wA(()=>{r.removeAttribute("autocapitalize"),t&&t()})}),this._pendingEditorState===null&&r.removeAttribute("autocapitalize"))}blur(){const t=this._rootElement;t!==null&&t.blur();const n=Lt(this._window);n!==null&&n.removeAllRanges()}isEditable(){return this._editable}setEditable(t){this._editable!==t&&(this._editable=t,ws("editable",this,!0,t))}toJSON(){return{editorState:this._editorState.toJSON()}}}ki.version="0.39.0+prod.esm";let Vd=null;function Sh(e){Vd=e}let mA=1;function Cb(e,t){const n=_h(e,t);return n===void 0&&q(30,t),n}function _h(e,t){return e._nodes.get(t)}const yA=typeof queueMicrotask=="function"?queueMicrotask:e=>{Promise.resolve().then(e)};function Sb(e){return _e(Ht(e))}function Th(e){const t=document.activeElement;if(!Be(t))return!1;const n=t.nodeName;return _e(Ht(e))&&(n==="INPUT"||n==="TEXTAREA"||t.contentEditable==="true"&&ec(t)==null)}function Qs(e,t,n){const r=e.getRootElement();try{return r!==null&&r.contains(t)&&r.contains(n)&&t!==null&&!Th(t)&&_b(t)===e}catch{return!1}}function Eh(e){return e instanceof ki}function _b(e){let t=e;for(;t!=null;){const n=ec(t);if(Eh(n))return n;t=ea(t)}return null}function ec(e){return e?e.__lexicalEditor:null}function xo(e){return Yl(e)||e.isToken()}function rr(e){return xo(e)||e.isSegmented()}function xr(e){return xn(e)&&e.nodeType===3}function Tb(e){return xn(e)&&e.nodeType===9}function Ai(e){let t=e;for(;t!=null;){if(xr(t))return t;t=t.firstChild}return null}function Sl(e,t,n){const r=jr[t];if(n!==null&&(e&r)===(n&r))return e;let o=e^r;return t==="subscript"?o&=-65:t==="superscript"?o&=-33:t==="lowercase"?(o&=-513,o&=-1025):t==="uppercase"?(o&=-257,o&=-1025):t==="capitalize"&&(o&=-257,o&=-513),o}function Eb(e){return X(e)||zn(e)||_e(e)}function Rb(e,t){const n=(function(){const s=Vd;return Vd=null,s})();if((t=t||n&&n.__key)!=null)return void(e.__key=t);ut(),pb();const r=$e(),o=qr(),i=""+mA++;o._nodeMap.set(i,e),B(e)?r._dirtyElements.set(i,!0):r._dirtyLeaves.add(i),r._cloneNotNeeded.add(i),r._dirtyType=1,e.__key=i}function bo(e){const t=e.getParent();if(t!==null){const n=e.getWritable(),r=t.getWritable(),o=e.getPreviousSibling(),i=e.getNextSibling(),s=i!==null?i.__key:null,a=o!==null?o.__key:null,l=o!==null?o.getWritable():null,c=i!==null?i.getWritable():null;o===null&&(r.__first=s),i===null&&(r.__last=a),l!==null&&(l.__next=s),c!==null&&(c.__prev=a),n.__prev=null,n.__next=null,n.__parent=null,r.__size--}}function _l(e){pb(),bl(e)&&q(323,e.__key,e.__type);const t=e.getLatest(),n=t.__parent,r=qr(),o=$e(),i=r._nodeMap,s=o._dirtyElements;n!==null&&(function(l,c,u){let f=l;for(;f!==null;){if(u.has(f))return;const d=c.get(f);if(d===void 0)break;u.set(f,!1),f=d.__parent}})(n,i,s);const a=t.__key;o._dirtyType=1,B(e)?s.set(a,!0):o._dirtyLeaves.add(a)}function gt(e){ut();const t=$e(),n=t._compositionKey;if(e!==n){if(t._compositionKey=e,n!==null){const r=Le(n);r!==null&&r.getWritable()}if(e!==null){const r=Le(e);r!==null&&r.getWritable()}}}function kr(){return Bi()?null:$e()._compositionKey}function Le(e,t){const n=(t||qr())._nodeMap.get(e);return n===void 0?null:n}function kb(e,t){const n=tc(e,$e());return n!==void 0?Le(n,t):null}function tc(e,t){return e[`__lexicalKey_${t._key}`]}function Ht(e,t){let n=e;for(;n!=null;){const r=kb(n,t);if(r!==null)return r;n=ea(n)}return null}function Ab(e){const t=e._decorators,n=Object.assign({},t);return e._pendingDecorators=n,n}function Bm(e){return e.read(()=>qe().getTextContent())}function qe(){return Mb(qr())}function Mb(e){return e._nodeMap.get("root")}function Ge(e){ut();const t=qr();e!==null&&(e.dirty=!0,e.setCachedNodes(null)),t._selection=e}function fi(e){const t=$e(),n=(function(r,o){let i=r;for(;i!=null;){const s=tc(i,o);if(s!==void 0)return s;i=ea(i)}return null})(e,t);return n===null?e===t.getRootElement()?Le("root"):null:Le(n)}function Nb(e){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(e)}function Rh(e){const t=[];let n=e;for(;n!==null;)t.push(n),n=n._parentEditor;return t}function Pb(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substring(0,5)}function Lb(e){return xr(e)?e.nodeValue:null}function kh(e,t,n){const r=Lt(dn(t));if(r===null)return;const o=r.anchorNode;let{anchorOffset:i,focusOffset:s}=r;if(o!==null){let a=Lb(o);const l=Ht(o);if(a!==null&&X(l)){if(a===Hl&&n){const c=n.length;a=n,i=c,s=c}a!==null&&Ah(l,a,i,s,e)}}}function Ah(e,t,n,r,o){let i=e;if(i.isAttached()&&(o||!i.isDirty())){const s=i.isComposing();let a=t;(s||o)&&t[t.length-1]===Hl&&(a=t.slice(0,-1));const l=i.getTextContent();if(o||a!==l){if(a===""){if(gt(null),Ys||Ii||Xs)i.remove();else{const p=$e();setTimeout(()=>{p.update(()=>{i.isAttached()&&i.remove()})},20)}return}const c=i.getParent(),u=qn(),f=i.getTextContentSize(),d=kr(),h=i.getKey();if(i.isToken()||d!==null&&h===d&&!s||W(u)&&(c!==null&&!c.canInsertTextBefore()&&u.anchor.offset===0||u.anchor.key===e.__key&&u.anchor.offset===0&&!i.canInsertTextBefore()&&!s||u.focus.key===e.__key&&u.focus.offset===f&&!i.canInsertTextAfter()&&!s))return void i.markDirty();const g=Y();if(!W(g)||n===null||r===null)return void zm(i,a,g);if(g.setTextNodeRange(i,n,i,r),i.isSegmented()){const p=Fe(i.getTextContent());i.replace(p),i=p}zm(i,a,g)}}}function zm(e,t,n){if(e.setTextContent(t),W(n)){const r=e.getKey();for(const o of["anchor","focus"]){const i=n[o];i.type==="text"&&i.key===r&&(i.offset=Kn(e,i.offset,"clamp"))}}}function _a(e,t,n){const r=t[n]||!1;return r==="any"||r===e[n]}function vA(e,t){return _a(e,t,"altKey")&&_a(e,t,"ctrlKey")&&_a(e,t,"shiftKey")&&_a(e,t,"metaKey")}function Pe(e,t,n){return vA(e,n)&&e.key.toLowerCase()===t.toLowerCase()}const er={ctrlKey:!vn,metaKey:vn},Hm={altKey:vn,ctrlKey:!vn};function Wm(e){return e.key==="Backspace"}function Km(e){return Pe(e,"a",er)}function xA(e){const t=qe();if(W(e)){const n=e.anchor,r=e.focus,o=n.getNode().getTopLevelElementOrThrow().getParentOrThrow();return n.set(o.getKey(),0,"element"),r.set(o.getKey(),o.getChildrenSize(),"element"),Ls(e),e}{const n=t.select(0,t.getChildrenSize());return Ge(Ls(n)),n}}function vi(e,t){e.__lexicalClassNameCache===void 0&&(e.__lexicalClassNameCache={});const n=e.__lexicalClassNameCache,r=n[t];if(r!==void 0)return r;const o=e[t];if(typeof o=="string"){const i=R1(o);return n[t]=i,i}return o}function Mh(e,t,n,r,o){if(n.size===0)return;const i=r.__type,s=r.__key,a=t.get(i);a===void 0&&q(33,i);const l=a.klass;let c=e.get(l);c===void 0&&(c=new Map,e.set(l,c));const u=c.get(s),f=u==="destroyed"&&o==="created";(u===void 0||f)&&c.set(s,f?"updated":o)}function Um(e,t,n){const r=e.getParent();let o=n,i=e;return r!==null&&(t&&n===0?(o=i.getIndexWithinParent(),i=r):t||n!==i.getChildrenSize()||(o=i.getIndexWithinParent()+1,i=r)),i.getChildAtIndex(t?o-1:o)}function Bd(e,t){const n=e.offset;if(e.type==="element")return Um(e.getNode(),t,n);{const r=e.getNode();if(t&&n===0||!t&&n===r.getTextContentSize()){const o=t?r.getPreviousSibling():r.getNextSibling();return o===null?Um(r.getParentOrThrow(),t,r.getIndexWithinParent()+(t?0:1)):o}}return null}function Fb(e){const t=dn(e).event,n=t&&t.inputType;return n==="insertFromPaste"||n==="insertFromPasteAsQuotation"}function Q(e,t,n){return(function(r,o,i){const s=Rh(r);for(let a=4;a>=0;a--)for(let l=0;l<s.length;l++){const c=s[l],u=c._commands.get(o);if(u!==void 0){const f=u[a];if(f!==void 0){const d=Array.from(f),h=d.length;let g=!1;if(Hn(c,()=>{for(let p=0;p<h;p++)if(d[p](i,r))return void(g=!0)}),g)return g}}}return!1})(e,t,n)}function nc(e){return!ot(e)&&!e.isLastChild()&&!e.isInline()}function Eo(e,t){const n=e._keyToDOMMap.get(t);return n===void 0&&q(75,t),n}function ea(e){const t=e.assignedSlot||e.parentElement;return Wd(t)?t.host:t}function $b(e){return Tb(e)?e:Be(e)?e.ownerDocument:null}function bA(e){ut(),$e()._updateTags.add(e)}function wA(e){ut(),$e()._deferred.push(e)}function zd(e,t){let n=e.getParent();for(;n!==null;){if(n.is(t))return!0;n=n.getParent()}return!1}function Nh(e){const t=$b(e);return t?t.defaultView:null}function dn(e){const t=e._window;return t===null&&q(78),t}function CA(e){return B(e)&&e.isInline()||_e(e)&&e.isInline()}function SA(e){let t=e.getParentOrThrow();for(;t!==null;){if(pt(t))return t;t=t.getParentOrThrow()}return t}function pt(e){return ot(e)||B(e)&&e.isShadowRoot()}function _A(e){const t=e.constructor.clone(e);return Rb(t,null),t.afterCloneFrom(e),t}function _t(e){const t=$e(),n=e.getType(),r=_h(t,n);r===void 0&&q(200,e.constructor.name,n);const{replace:o,replaceWithKlass:i}=r;if(o!==null){const s=o(e),a=s.constructor;return i!==null?s instanceof i||q(201,i.name,i.getType(),a.name,a.getType(),e.constructor.name,n):s instanceof e.constructor&&a!==e.constructor||q(202,a.name,a.getType(),e.constructor.name,n),s.__key===e.__key&&q(203,e.constructor.name,n,a.name,a.getType()),s}return e}function Qc(e,t){!ot(e.getParent())||B(t)||_e(t)||q(99)}function TA(e){const t=Le(e);return t===null&&q(63,e),t}function eu(e){return(_e(e)||B(e)&&!e.canBeEmpty())&&!e.isInline()}function Hd(e,t,n){n.style.removeProperty("caret-color"),t._blockCursorElement=null;const r=e.parentElement;r!==null&&r.removeChild(e)}function Lt(e){return Mn?(e||window).getSelection():null}function EA(e){const t=Nh(e);return t?t.getSelection():null}function Ob(e){return Be(e)&&e.tagName==="A"}function Be(e){return xn(e)&&e.nodeType===1}function xn(e){return typeof e=="object"&&e!==null&&"nodeType"in e&&typeof e.nodeType=="number"}function Wd(e){return xn(e)&&e.nodeType===11}function Kd(e){const t=new RegExp(/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|mark|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var|#text)$/,"i");return e.nodeName.match(t)!==null}function Tl(e){const t=new RegExp(/^(address|article|aside|blockquote|canvas|dd|div|dl|dt|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hr|li|main|nav|noscript|ol|p|pre|section|table|td|tfoot|ul|video)$/,"i");return e.nodeName.match(t)!==null}function Rr(e){if(_e(e)&&!e.isInline())return!0;if(!B(e)||pt(e))return!1;const t=e.getFirstChild(),n=t===null||zn(t)||X(t)||t.isInline();return!e.isInline()&&e.canBeEmpty()!==!1&&n}function Hi(){return $e()}const Gm=new WeakMap,RA=new Map;function qm(e){if(!e._readOnly&&e.isEmpty())return RA;e._readOnly||q(192);let t=Gm.get(e);return t||(t=(function(n){const r=new Map;for(const[o,i]of n._nodeMap){const s=i.__type;let a=r.get(s);a||(a=new Map,r.set(s,a)),a.set(o,i)}return r})(e),Gm.set(e,t)),t}function Ib(e){const t=e.constructor.clone(e);return t.afterCloneFrom(e),t}function kA(e){return(t=Ib(e))[ab]=!0,t;var t}function Ph(e,t){const n=parseInt(e.style.paddingInlineStart,10)||0,r=Math.round(n/40);t.setIndent(r)}function AA(e){e.__lexicalUnmanaged=!0}function MA(e){return e.__lexicalUnmanaged===!0}function ts(e,t){return(function(n,r){return Object.prototype.hasOwnProperty.call(n,r)})(e,t)&&e[t]!==Bn[t]}function rc(e){const t=am in e.prototype?e.prototype[am]():void 0,n=(function(s){if(!(s===Bn||s.prototype instanceof Bn)){let a="<unknown>",l="<unknown>";try{a=s.getType()}catch{}try{ki.version&&(l=JSON.parse(ki.version))}catch{}q(290,s.name,a,l)}return s===Zs||s===St||s===Bn})(e),r=!n&&ts(e,"getType")?e.getType():void 0;let o,i=r;if(t)if(r)o=t[r];else for(const[s,a]of Object.entries(t))i=s,o=a;if(!n&&i&&(ts(e,"getType")||(e.getType=()=>i),ts(e,"clone")||(e.clone=s=>(Sh(s),new e)),ts(e,"importJSON")||(e.importJSON=o&&o.$importJSON||(s=>new e().updateFromJSON(s))),!ts(e,"importDOM")&&o)){const{importDOM:s}=o;s&&(e.importDOM=()=>s)}return{ownNodeConfig:o,ownNodeType:i}}function Db(e){const t=Hi();return ut(),new(t.resolveRegisteredNodeAfterReplacements(t.getRegisteredNode(e))).klass}const we=(e,t)=>{let n=e;for(;n!=null&&!ot(n);){if(t(n))return n;n=n.getParent()}return null},NA={next:"previous",previous:"next"};class Lh{origin;constructor(t){this.origin=t}[Symbol.iterator](){return Oh({hasNext:Vr,initial:this.getAdjacentCaret(),map:t=>t,step:t=>t.getAdjacentCaret()})}getAdjacentCaret(){return tt(this.getNodeAtCaret(),this.direction)}getSiblingCaret(){return tt(this.origin,this.direction)}remove(){const t=this.getNodeAtCaret();return t&&t.remove(),this}replaceOrInsert(t,n){const r=this.getNodeAtCaret();return t.is(this.origin)||t.is(r)||(r===null?this.insert(t):r.replace(t,n)),this}splice(t,n,r="next"){const o=r===this.direction?n:Array.from(n).reverse();let i=this;const s=this.getParentAtCaret(),a=new Map;for(let l=i.getAdjacentCaret();l!==null&&a.size<t;l=l.getAdjacentCaret()){const c=l.origin.getWritable();a.set(c.getKey(),c)}for(const l of o){if(a.size>0){const c=i.getNodeAtCaret();if(c){if(a.delete(c.getKey()),a.delete(l.getKey()),!(c.is(l)||i.origin.is(l))){const u=l.getParent();u&&u.is(s)&&l.remove(),c.replace(l)}}else c===null&&q(263,Array.from(a).join(" "))}else i.insert(l);i=tt(l,this.direction)}for(const l of a.values())l.remove();return this}}class Is extends Lh{type="child";getLatest(){const t=this.origin.getLatest();return t===this.origin?this:Nt(t,this.direction)}getParentCaret(t="root"){return tt(Fh(this.getParentAtCaret(),t),this.direction)}getFlipped(){const t=Do(this.direction);return tt(this.getNodeAtCaret(),t)||Nt(this.origin,t)}getParentAtCaret(){return this.origin}getChildCaret(){return this}isSameNodeCaret(t){return t instanceof Is&&this.direction===t.direction&&this.origin.is(t.origin)}isSamePointCaret(t){return this.isSameNodeCaret(t)}}const PA={root:ot,shadowRoot:pt};function Do(e){return NA[e]}function Fh(e,t="root"){return PA[t](e)?null:e}class Ro extends Lh{type="sibling";getLatest(){const t=this.origin.getLatest();return t===this.origin?this:tt(t,this.direction)}getSiblingCaret(){return this}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return B(this.origin)?Nt(this.origin,this.direction):null}getParentCaret(t="root"){return tt(Fh(this.getParentAtCaret(),t),this.direction)}getFlipped(){const t=Do(this.direction);return tt(this.getNodeAtCaret(),t)||Nt(this.origin.getParentOrThrow(),t)}isSamePointCaret(t){return t instanceof Ro&&this.direction===t.direction&&this.origin.is(t.origin)}isSameNodeCaret(t){return(t instanceof Ro||t instanceof ko)&&this.direction===t.direction&&this.origin.is(t.origin)}}class ko extends Lh{type="text";offset;constructor(t,n){super(t),this.offset=n}getLatest(){const t=this.origin.getLatest();return t===this.origin?this:Ao(t,this.direction,this.offset)}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return null}getParentCaret(t="root"){return tt(Fh(this.getParentAtCaret(),t),this.direction)}getFlipped(){return Ao(this.origin,Do(this.direction),this.offset)}isSamePointCaret(t){return t instanceof ko&&this.direction===t.direction&&this.origin.is(t.origin)&&this.offset===t.offset}isSameNodeCaret(t){return(t instanceof Ro||t instanceof ko)&&this.direction===t.direction&&this.origin.is(t.origin)}getSiblingCaret(){return tt(this.origin,this.direction)}}function Wn(e){return e instanceof ko}function Vr(e){return e instanceof Ro}function jt(e){return e instanceof Is}const LA={next:class extends ko{direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends ko{direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},FA={next:class extends Ro{direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends Ro{direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},$A={next:class extends Is{direction="next";getNodeAtCaret(){return this.origin.getFirstChild()}insert(e){return this.origin.splice(0,0,[e]),this}},previous:class extends Is{direction="previous";getNodeAtCaret(){return this.origin.getLastChild()}insert(e){return this.origin.splice(this.origin.getChildrenSize(),0,[e]),this}}};function tt(e,t){return e?new FA[t](e):null}function Ao(e,t,n){return e?new LA[t](e,Kn(e,n)):null}function Kn(e,t,n="error"){const r=e.getTextContentSize();let o=t==="next"?r:t==="previous"?0:t;return(o<0||o>r)&&(n!=="clamp"&&T1(284,String(t),String(r),e.getKey()),o=o<0?0:r),o}function Ym(e,t){return new IA(e,t)}function Nt(e,t){return B(e)?new $A[t](e):null}function OA(e){return e&&e.getChildCaret()||e}function ta(e){return e&&OA(e.getAdjacentCaret())}class $h{type="node-caret-range";direction;anchor;focus;constructor(t,n,r){this.anchor=t,this.focus=n,this.direction=r}getLatest(){const t=this.anchor.getLatest(),n=this.focus.getLatest();return t===this.anchor&&n===this.focus?this:new $h(t,n,this.direction)}isCollapsed(){return this.anchor.isSamePointCaret(this.focus)}getTextSlices(){const t=o=>{const i=this[o].getLatest();return Wn(i)?(function(s,a){const{direction:l,origin:c}=s,u=Kn(c,a==="focus"?Do(l):l);return Ym(s,u-s.offset)})(i,o):null},n=t("anchor"),r=t("focus");if(n&&r){const{caret:o}=n,{caret:i}=r;if(o.isSameNodeCaret(i))return[Ym(o,i.offset-o.offset),null]}return[n,r]}iterNodeCarets(t="root"){const n=Wn(this.anchor)?this.anchor.getSiblingCaret():this.anchor.getLatest(),r=this.focus.getLatest(),o=Wn(r),i=s=>s.isSameNodeCaret(r)?null:ta(s)||s.getParentCaret(t);return Oh({hasNext:s=>s!==null&&!(o&&r.isSameNodeCaret(s)),initial:n.isSameNodeCaret(r)?null:i(n),map:s=>s,step:i})}[Symbol.iterator](){return this.iterNodeCarets("root")}}class IA{type="slice";caret;distance;constructor(t,n){this.caret=t,this.distance=n}getSliceIndices(){const{distance:t,caret:{offset:n}}=this,r=n+t;return r<n?[r,n]:[n,r]}getTextContent(){const[t,n]=this.getSliceIndices();return this.caret.origin.getTextContent().slice(t,n)}getTextContentSize(){return Math.abs(this.distance)}removeTextSlice(){const{caret:{origin:t,direction:n}}=this,[r,o]=this.getSliceIndices(),i=t.getTextContent();return Ao(t.setTextContent(i.slice(0,r)+i.slice(o)),n,r)}}function Ds(e){return Br(e,tt(qe(),e.direction))}function jb(e){return Br(e,e)}function Br(e,t){return e.direction!==t.direction&&q(265),new $h(e,t,e.direction)}function Oh(e){const{initial:t,hasNext:n,step:r,map:o}=e;let i=t;return{[Symbol.iterator](){return this},next(){if(!n(i))return{done:!0,value:void 0};const s={done:!1,value:o(i)};return i=r(i),s}}}function Vb(e,t){const n=Za(e.origin,t.origin);switch(n===null&&q(275,e.origin.getKey(),t.origin.getKey()),n.type){case"same":{const r=e.type==="text",o=t.type==="text";return r&&o?(function(i,s){return Math.sign(i-s)})(e.offset,t.offset):e.type===t.type?0:r?-1:o?1:e.type==="child"?-1:1}case"ancestor":return e.type==="child"?-1:1;case"descendant":return t.type==="child"?1:-1;case"branch":return Bb(n)}}function Bb(e){const{a:t,b:n}=e,r=t.__key,o=n.__key;let i=t,s=n;for(;i&&s;i=i.getNextSibling(),s=s.getNextSibling()){if(i.__key===o)return-1;if(s.__key===r)return 1}return i===null?1:-1}function Ta(e,t){return t.is(e)}function Xm(e){return B(e)?[e.getLatest(),null]:[e.getParent(),e.getLatest()]}function Za(e,t){if(e.is(t))return{commonAncestor:e,type:"same"};const n=new Map;for(let[r,o]=Xm(e);r;o=r,r=r.getParent())n.set(r,o);for(let[r,o]=Xm(t);r;o=r,r=r.getParent()){const i=n.get(r);if(i!==void 0)return i===null?(Ta(e,r)||q(276),{commonAncestor:r,type:"ancestor"}):o===null?(Ta(t,r)||q(277),{commonAncestor:r,type:"descendant"}):((B(i)||Ta(e,i))&&(B(o)||Ta(t,o))&&r.is(i.getParent())&&r.is(o.getParent())||q(278),{a:i,b:o,commonAncestor:r,type:"branch"})}return null}function En(e,t){const{type:n,key:r,offset:o}=e,i=TA(e.key);return n==="text"?(X(i)||q(266,i.getType(),r),Ao(i,t,o)):(B(i)||q(267,i.getType(),r),jA(i,e.offset,t))}function bn(e,t){const{origin:n,direction:r}=t,o=r==="next";Wn(t)?e.set(n.getKey(),t.offset,"text"):Vr(t)?X(n)?e.set(n.getKey(),Kn(n,r),"text"):e.set(n.getParentOrThrow().getKey(),n.getIndexWithinParent()+(o?1:0),"element"):(jt(t)&&B(n)||q(268),e.set(n.getKey(),o?0:n.getChildrenSize(),"element"))}function zb(e){const t=Y(),n=W(t)?t:Zl();return Ja(n,e),Ge(n),n}function Ja(e,t){bn(e.anchor,t.anchor),bn(e.focus,t.focus)}function Zm(e){const{anchor:t,focus:n}=e,r=En(t,"next"),o=En(n,"next"),i=Vb(r,o)<=0?"next":"previous";return Br(yr(r,i),yr(o,i))}function na(e){const{direction:t,origin:n}=e,r=tt(n,Do(t)).getNodeAtCaret();return r?tt(r,t):Nt(n.getParentOrThrow(),t)}function Jm(e,t="root"){const n=[e];for(let r=jt(e)?e.getParentCaret(t):e.getSiblingCaret();r!==null;r=r.getParentCaret(t))n.push(na(r));return n}function tu(e){return!!e&&e.origin.isAttached()}function DA(e,t="removeEmptySlices"){if(e.isCollapsed())return e;const n="root",r="next";let o=t;const i=Hb(e,r),s=Jm(i.anchor,n),a=Jm(i.focus.getFlipped(),n),l=new Set,c=[];for(const g of i.iterNodeCarets(n))if(jt(g))l.add(g.origin.getKey());else if(Vr(g)){const{origin:p}=g;B(p)&&!l.has(p.getKey())||c.push(p)}for(const g of c)g.remove();for(const g of i.getTextSlices()){if(!g)continue;const{origin:p}=g.caret,m=p.getTextContentSize(),x=na(tt(p,r)),y=p.getMode();if(Math.abs(g.distance)===m&&o==="removeEmptySlices"||y==="token"&&g.distance!==0)x.remove();else if(g.distance!==0){o="removeEmptySlices";let v=g.removeTextSlice();const b=g.caret.origin;if(y==="segmented"){const w=v.origin,_=Fe(w.getTextContent()).setStyle(w.getStyle()).setFormat(w.getFormat());x.replaceOrInsert(_),v=Ao(_,r,v.offset)}b.is(s[0].origin)&&(s[0]=v),b.is(a[0].origin)&&(a[0]=v.getFlipped())}}let u,f;for(const g of s)if(tu(g)){u=Mt(g);break}for(const g of a)if(tu(g)){f=Mt(g);break}const d=(function(g,p,m){if(!g||!p)return null;const x=g.getParentAtCaret(),y=p.getParentAtCaret();if(!x||!y)return null;const v=x.getParents().reverse();v.push(x);const b=y.getParents().reverse();b.push(y);const w=Math.min(v.length,b.length);let _;for(_=0;_<w&&v[_]===b[_];_++);const E=(P,O)=>{let D;for(let I=_;I<P.length;I++){const $=P[I];if(pt($))return;!D&&O($)&&(D=$)}return D},T=E(v,Rr),k=T&&E(b,P=>m.has(P.getKey())&&Rr(P));return T&&k?[T,k]:null})(u,f,l);if(d){const[g,p]=d;Nt(g,"previous").splice(0,p.getChildren()),p.remove()}const h=[u,f,...s,...a].find(tu);if(h)return jb(yr(Mt(h),e.direction));q(269,JSON.stringify(s.map(g=>g.origin.__key)))}function Mt(e){const t=(function(o){let i=o;for(;jt(i);){const s=ta(i);if(!jt(s))break;i=s}return i})(e.getLatest()),{direction:n}=t;if(X(t.origin))return Wn(t)?t:Ao(t.origin,n,n);const r=t.getAdjacentCaret();return Vr(r)&&X(r.origin)?Ao(r.origin,n,Do(n)):t}function Ih(e){return Wn(e)&&e.offset!==Kn(e.origin,e.direction)}function yr(e,t){return e.direction===t?e:e.getFlipped()}function Hb(e,t){return e.direction===t?e:Br(yr(e.focus,t),yr(e.anchor,t))}function jA(e,t,n){let r=Nt(e,"next");for(let o=0;o<t;o++){const i=r.getAdjacentCaret();if(i===null)break;r=i}return yr(r,n)}function VA(e){const{origin:t,offset:n,direction:r}=e;if(n===Kn(t,r))return e.getSiblingCaret();if(n===Kn(t,Do(r)))return na(e.getSiblingCaret());const[o]=t.splitText(n);return X(o)||q(281),yr(tt(o,"next"),r)}function BA(e,t){return!0}function zA(e,{$copyElementNode:t=_A,$splitTextPointCaretNext:n=VA,rootMode:r="shadowRoot",$shouldSplit:o=BA}={}){if(Wn(e))return n(e);const i=e.getParentCaret(r);if(i){const{origin:s}=i;if(jt(e)&&(!s.canBeEmpty()||!o(s,"first")))return na(i);const a=(function(l){const c=[];for(let u=l.getAdjacentCaret();u;u=u.getAdjacentCaret())c.push(u.origin);return c})(e);(a.length>0||s.canBeEmpty()&&o(s,"last"))&&i.insert(t(s).splice(0,0,a))}return i}function HA(e,t){if(!t||e===t)return e;for(const n in t)if(e[n]!==t[n])return{...e,...t};return e}const Ud=new Map;function Wb(e){const t={};if(!e)return t;const n=e.split(";");for(const r of n)if(r!==""){const[o,i]=r.split(/:([^]+)/);o&&i&&(t[o.trim()]=i.trim())}return t}function Qm(e){let t=Ud.get(e);return t===void 0&&(t=Wb(e),Ud.set(e,t)),t}function Kb(e){const t=Hi().getElementByKey(e.getKey());if(t===null)return null;const n=t.ownerDocument.defaultView;return n===null?null:n.getComputedStyle(t)}function Ub(e){return Kb(ot(e)?e:e.getParentOrThrow())}function ey(e){const t=Ub(e);return t!==null&&t.direction==="rtl"}function Gb(e,t,n="self"){const r=e.getStartEndPoints();if(t.isSelected(e)&&!rr(t)&&r!==null){const[o,i]=r,s=e.isBackward(),a=o.getNode(),l=i.getNode(),c=t.is(a),u=t.is(l);if(c||u){const[f,d]=Dd(e),h=a.is(l),g=t.is(s?l:a),p=t.is(s?a:l);let m,x=0;h?(x=f>d?d:f,m=f>d?f:d):g?(x=s?d:f,m=void 0):p&&(x=0,m=s?f:d);const y=t.__text.slice(x,m);y!==t.__text&&(n==="clone"&&(t=kA(t)),t.__text=y)}}return t}function WA(e){const t=e.getStyle(),n=Wb(t);Ud.set(t,n)}function qb(e){const t=Yb(e);return t!==null&&t.writingMode==="vertical-rl"}function Yb(e){const t=e.anchor.getNode();return B(t)?Kb(t):Ub(t)}function ty(e,t){let n=qb(e)?!t:t;Xb(e)&&(n=!n);const r=En(e.focus,n?"previous":"next");if(Ih(r))return!1;for(const o of Ds(r)){if(jt(o))return!o.origin.isInline();if(!B(o.origin)){if(_e(o.origin))return!0;break}}return!1}function KA(e,t,n,r){e.modify(t?"extend":"move",n,r)}function Xb(e){const t=Yb(e);return t!==null&&t.direction==="rtl"}function ny(e,t,n){const r=Xb(e);let o;o=qb(e)||r?!n:n,KA(e,t,o,"character")}function Zb(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const o of t)r.append("v",o);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const Jb=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,UA=Jb&&"documentMode"in document?document.documentMode:null;!(!Jb||!("InputEvent"in window)||UA)&&"getTargetRanges"in new window.InputEvent("input");function Qb(...e){const t=[];for(const n of e)if(n&&typeof n=="string")for(const[r]of n.matchAll(/\S+/g))t.push(r);return t}function Rn(...e){return()=>{for(let t=e.length-1;t>=0;t--)e[t]();e.length=0}}function Qe(e,...t){const n=Qb(...t);n.length>0&&e.classList.add(...n)}function Un(e,...t){const n=Qb(...t);n.length>0&&e.classList.remove(...n)}function GA(e){return e?e.getAdjacentCaret():null}function qA(e,t){let n=e;for(;n!=null;){if(n instanceof t)return n;n=n.getParent()}return null}function YA(e){const t=we(e,n=>B(n)&&!n.isInline());return B(t)||Zb(4,e.__key),t}function XA(e){const t=Y()||qn();let n;if(W(t))n=En(t.focus,"next");else{if(t!=null){const s=t.getNodes(),a=s[s.length-1];a&&(n=tt(a,"next"))}n=n||Nt(qe(),"previous").getFlipped().insert(ye())}const r=ZA(e,n),o=ta(r),i=jt(o)?Mt(o):r;return zb(jb(i)),e.getLatest()}function ZA(e,t,n){let r=yr(t,"next");for(let o=r;o;o=zA(o,n))r=o;return Wn(r)&&Zb(283),r.insert(e.isInline()?ye().append(e):e),yr(tt(e.getLatest(),"next"),t.direction)}function Ar(e,t){return e!==null&&Object.getPrototypeOf(e).constructor.name===t.name}function JA(e,t){Nt(e,"next").insert(t)}function ew(e,t){return tw(e,t,null)}function tw(e,t,n){let r=!1;for(const o of rw(e))t(o)?n!==null&&n(o):(r=!0,B(o)&&tw(o,t,n||(i=>o.insertAfter(i))),o.remove());return r}function nw(e,t){const n=[],r=Array.from(e).reverse();for(let o=r.pop();o!==void 0;o=r.pop())if(t(o))n.push(o);else if(B(o))for(const i of rw(o))r.push(i);return n}function rw(e){return QA(Nt(e,"previous"))}function QA(e){return Oh({hasNext:Vr,initial:e.getAdjacentCaret(),map:t=>t.origin.getLatest(),step:t=>t.getAdjacentCaret()})}function ow(){const[e]=it(),[t,n]=S.useState(!1),[r,o]=S.useState(!1),[i,s]=S.useState(!1),[a,l]=S.useState(!1),[c,u]=S.useState("left"),f=c==="left",d=c==="center",h=c==="right",g=S.useCallback(()=>{const x=Y();W(x)&&(n(x.hasFormat("bold")),o(x.hasFormat("italic")),s(x.hasFormat("underline")),l(x.hasFormat("strikethrough")))},[]),p=S.useCallback(x=>{u(x)},[]),m=S.useCallback(()=>{const x=Y();if(!W(x))return;const y=x.anchor.getNode(),v=y.getKey()==="root"?y:y.getTopLevelElementOrThrow();if(B(v)){const b=v.getFormatType();p(b)}},[p]);return S.useEffect(()=>{const x=Rn(e.registerCommand(It,(y,v)=>(e.read(()=>{g()}),!1),ar),e.registerCommand(pi,(y,v)=>(e.read(()=>{p(y)}),!1),ar),e.registerCommand(cr,(y,v)=>(e.read(()=>{g(),m()}),!1),ar));return()=>{x()}},[e,g,p,m]),{isBold:t,isItalic:r,isUnderline:i,isStrikethrough:a,alignment:c,isAlignLeft:f,isAlignCenter:d,isAlignRight:h}}var ie=(e=>(e.BOLD="font-bold",e.ITALIC="font-italic",e.UNDERLINE="font-underline",e.STRIKETHROUGH="font-strikethrough",e.ALIGN_LEFT="align-left",e.ALIGN_CENTER="align-center",e.ALIGN_RIGHT="align-right",e.LINK="insert-link",e.IMAGE="insert-image",e.TABLE="insert-table",e.BULLET_LIST="insert-bullet-list",e.NUMBERED_LIST="insert-numbered-list",e))(ie||{});function eM(){const{isBold:e,isItalic:t,isUnderline:n,isStrikethrough:r,isAlignLeft:o,isAlignCenter:i,isAlignRight:s}=ow(),l=qs().toolbar.actions,{availableActions:c}=Zk(),u=S.useMemo(()=>({id:ie.BOLD,IconComponent:zk,label:l.bold,isActive:e}),[l.bold,e]),f=S.useMemo(()=>({id:ie.ITALIC,IconComponent:Wk,label:l.italic,isActive:t}),[l.italic,t]),d=S.useMemo(()=>({id:ie.UNDERLINE,IconComponent:Xk,label:l.underline,isActive:n}),[l.underline,n]),h=S.useMemo(()=>({id:ie.STRIKETHROUGH,IconComponent:qk,label:l.strikethrough,isActive:r}),[l.strikethrough,r]),g=S.useMemo(()=>({id:ie.ALIGN_LEFT,IconComponent:Vk,label:l.alignLeft,isActive:o}),[l.alignLeft,o]),p=S.useMemo(()=>({id:ie.ALIGN_CENTER,IconComponent:jk,label:l.alignCenter,isActive:i}),[l.alignCenter,i]),m=S.useMemo(()=>({id:ie.ALIGN_RIGHT,IconComponent:Bk,label:l.alignRight,isActive:s}),[l.alignRight,s]),x=S.useMemo(()=>({id:ie.BULLET_LIST,IconComponent:Uk,label:l.bulletList}),[l.bulletList]),y=S.useMemo(()=>({id:ie.NUMBERED_LIST,IconComponent:Gk,label:l.numberedList}),[l.numberedList]),v=S.useMemo(()=>({id:ie.LINK,IconComponent:Kk,label:l.link}),[l.link]),b=S.useMemo(()=>({id:ie.IMAGE,IconComponent:Hk,label:l.image}),[l.image]),w=S.useMemo(()=>({id:ie.TABLE,IconComponent:Yk,label:l.table}),[l.table]),_=S.useMemo(()=>({[ie.BOLD]:u,[ie.ITALIC]:f,[ie.UNDERLINE]:d,[ie.STRIKETHROUGH]:h,[ie.ALIGN_LEFT]:g,[ie.ALIGN_CENTER]:p,[ie.ALIGN_RIGHT]:m,[ie.BULLET_LIST]:x,[ie.NUMBERED_LIST]:y,[ie.LINK]:v,[ie.IMAGE]:b,[ie.TABLE]:w}),[u,f,d,h,g,p,m,x,y,v,b,w]),E=S.useMemo(()=>c.map(k=>k.map(P=>_[P])),[c,_]);return{availableActions:S.useMemo(()=>E.flat(),[E]),availableActionGroups:E}}const tM=Symbol.for("preact-signals");function Dh(){if(xi>1)return void xi--;let e,t=!1;for(;Ss!==void 0;){let n=Ss;for(Ss=void 0,Gd++;n!==void 0;){const r=n.o;if(n.o=void 0,n.f&=-3,!(8&n.f)&&sw(n))try{n.c()}catch(o){t||(e=o,t=!0)}n=r}}if(Gd=0,xi--,t)throw e}let Ne,Ss;function ry(e){const t=Ne;Ne=void 0;try{return e()}finally{Ne=t}}let xi=0,Gd=0,Qa=0;function oy(e){if(Ne===void 0)return;let t=e.n;return t===void 0||t.t!==Ne?(t={i:0,S:e,p:Ne.s,n:void 0,t:Ne,e:void 0,x:void 0,r:t},Ne.s!==void 0&&(Ne.s.n=t),Ne.s=t,e.n=t,32&Ne.f&&e.S(t),t):t.i===-1?(t.i=0,t.n!==void 0&&(t.n.p=t.p,t.p!==void 0&&(t.p.n=t.n),t.p=Ne.s,t.n=void 0,Ne.s.n=t,Ne.s=t),t):void 0}function Rt(e,t){this.v=e,this.i=0,this.n=void 0,this.t=void 0,this.W=t?.watched,this.Z=t?.unwatched,this.name=t?.name}function iw(e,t){return new Rt(e,t)}function sw(e){for(let t=e.s;t!==void 0;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function iy(e){for(let t=e.s;t!==void 0;t=t.n){const n=t.S.n;if(n!==void 0&&(t.r=n),t.S.n=t,t.i=-1,t.n===void 0){e.s=t;break}}}function aw(e){let t,n=e.s;for(;n!==void 0;){const r=n.p;n.i===-1?(n.S.U(n),r!==void 0&&(r.n=n.n),n.n!==void 0&&(n.n.p=r)):t=n,n.S.n=n.r,n.r!==void 0&&(n.r=void 0),n=r}e.s=t}function Ho(e,t){Rt.call(this,void 0),this.x=e,this.s=void 0,this.g=Qa-1,this.f=4,this.W=t?.watched,this.Z=t?.unwatched,this.name=t?.name}function lw(e){const t=e.u;if(e.u=void 0,typeof t=="function"){xi++;const n=Ne;Ne=void 0;try{t()}catch(r){throw e.f&=-2,e.f|=8,jh(e),r}finally{Ne=n,Dh()}}}function jh(e){for(let t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,lw(e)}function nM(e){if(Ne!==this)throw new Error("Out-of-order effect");aw(this),Ne=e,this.f&=-2,8&this.f&&jh(this),Dh()}function ni(e,t){this.x=e,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32,this.name=t?.name}function rM(e,t){const n=new ni(e,t);try{n.c()}catch(o){throw n.d(),o}const r=n.d.bind(n);return r[Symbol.dispose]=r,r}Rt.prototype.brand=tM,Rt.prototype.h=function(){return!0},Rt.prototype.S=function(e){const t=this.t;t!==e&&e.e===void 0&&(e.x=t,this.t=e,t!==void 0?t.e=e:ry(()=>{var n;(n=this.W)==null||n.call(this)}))},Rt.prototype.U=function(e){if(this.t!==void 0){const t=e.e,n=e.x;t!==void 0&&(t.x=n,e.e=void 0),n!==void 0&&(n.e=t,e.x=void 0),e===this.t&&(this.t=n,n===void 0&&ry(()=>{var r;(r=this.Z)==null||r.call(this)}))}},Rt.prototype.subscribe=function(e){return rM(()=>{const t=this.value,n=Ne;Ne=void 0;try{e(t)}finally{Ne=n}},{name:"sub"})},Rt.prototype.valueOf=function(){return this.value},Rt.prototype.toString=function(){return this.value+""},Rt.prototype.toJSON=function(){return this.value},Rt.prototype.peek=function(){const e=Ne;Ne=void 0;try{return this.value}finally{Ne=e}},Object.defineProperty(Rt.prototype,"value",{get(){const e=oy(this);return e!==void 0&&(e.i=this.i),this.v},set(e){if(e!==this.v){if(Gd>100)throw new Error("Cycle detected");this.v=e,this.i++,Qa++,xi++;try{for(let t=this.t;t!==void 0;t=t.x)t.t.N()}finally{Dh()}}}}),Ho.prototype=new Rt,Ho.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===Qa))return!0;if(this.g=Qa,this.f|=1,this.i>0&&!sw(this))return this.f&=-2,!0;const e=Ne;try{iy(this),Ne=this;const t=this.x();(16&this.f||this.v!==t||this.i===0)&&(this.v=t,this.f&=-17,this.i++)}catch(t){this.v=t,this.f|=16,this.i++}return Ne=e,aw(this),this.f&=-2,!0},Ho.prototype.S=function(e){if(this.t===void 0){this.f|=36;for(let t=this.s;t!==void 0;t=t.n)t.S.S(t)}Rt.prototype.S.call(this,e)},Ho.prototype.U=function(e){if(this.t!==void 0&&(Rt.prototype.U.call(this,e),this.t===void 0)){this.f&=-33;for(let t=this.s;t!==void 0;t=t.n)t.S.U(t)}},Ho.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(let e=this.t;e!==void 0;e=e.x)e.t.N()}},Object.defineProperty(Ho.prototype,"value",{get(){if(1&this.f)throw new Error("Cycle detected");const e=oy(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}}),ni.prototype.c=function(){const e=this.S();try{if(8&this.f||this.x===void 0)return;const t=this.x();typeof t=="function"&&(this.u=t)}finally{e()}},ni.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,lw(this),iy(this),xi++;const e=Ne;return Ne=this,nM.bind(this,e)},ni.prototype.N=function(){2&this.f||(this.f|=2,this.o=Ss,Ss=this)},ni.prototype.d=function(){this.f|=8,1&this.f||jh(this)},ni.prototype.dispose=function(){this.d()};function oM(e){return(typeof e.nodes=="function"?e.nodes():e.nodes)||[]}function Ie(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const o of t)r.append("v",o);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function cw(e,t){if(e&&t&&!Array.isArray(t)&&typeof e=="object"&&typeof t=="object"){const n=e,r=t;for(const o in r)n[o]=cw(n[o],r[o]);return e}return t}const Vh=0,qd=1,uw=2,nu=3,Ea=4,Wo=5,ru=6,ns=7;function ou(e){return e.id===Vh}function dw(e){return e.id===uw}function iM(e){return(function(t){return t.id===qd})(e)||Ie(305,String(e.id),String(qd)),Object.assign(e,{id:uw})}const sM=new Set;let aM=class{builder;configs;_dependency;_peerNameSet;extension;state;_signal;constructor(t,n){this.builder=t,this.extension=n,this.configs=new Set,this.state={id:Vh}}mergeConfigs(){let t=this.extension.config||{};const n=this.extension.mergeConfig?this.extension.mergeConfig.bind(this.extension):HA;for(const r of this.configs)t=n(t,r);return t}init(t){const n=this.state;dw(n)||Ie(306,String(n.id));const r={getDependency:this.getInitDependency.bind(this),getDirectDependentNames:this.getDirectDependentNames.bind(this),getPeer:this.getInitPeer.bind(this),getPeerNameSet:this.getPeerNameSet.bind(this)},o={...r,getDependency:this.getDependency.bind(this),getInitResult:this.getInitResult.bind(this),getPeer:this.getPeer.bind(this)},i=(function(a,l,c){return Object.assign(a,{config:l,id:nu,registerState:c})})(n,this.mergeConfigs(),r);let s;this.state=i,this.extension.init&&(s=this.extension.init(t,i.config,r)),this.state=(function(a,l,c){return Object.assign(a,{id:Ea,initResult:l,registerState:c})})(i,s,o)}build(t){const n=this.state;let r;n.id!==Ea&&Ie(307,String(n.id),String(Wo)),this.extension.build&&(r=this.extension.build(t,n.config,n.registerState));const o={...n.registerState,getOutput:()=>r,getSignal:this.getSignal.bind(this)};this.state=(function(i,s,a){return Object.assign(i,{id:Wo,output:s,registerState:a})})(n,r,o)}register(t,n){this._signal=n;const r=this.state;r.id!==Wo&&Ie(308,String(r.id),String(Wo));const o=this.extension.register&&this.extension.register(t,r.config,r.registerState);return this.state=(function(i){return Object.assign(i,{id:ru})})(r),()=>{const i=this.state;i.id!==ns&&Ie(309,String(r.id),String(ns)),this.state=(function(s){return Object.assign(s,{id:Wo})})(i),o&&o()}}afterRegistration(t){const n=this.state;let r;return n.id!==ru&&Ie(310,String(n.id),String(ru)),this.extension.afterRegistration&&(r=this.extension.afterRegistration(t,n.config,n.registerState)),this.state=(function(o){return Object.assign(o,{id:ns})})(n),r}getSignal(){return this._signal===void 0&&Ie(311),this._signal}getInitResult(){this.extension.init===void 0&&Ie(312,this.extension.name);const t=this.state;return(function(n){return n.id>=Ea})(t)||Ie(313,String(t.id),String(Ea)),t.initResult}getInitPeer(t){const n=this.builder.extensionNameMap.get(t);return n?n.getExtensionInitDependency():void 0}getExtensionInitDependency(){const t=this.state;return(function(n){return n.id>=nu})(t)||Ie(314,String(t.id),String(nu)),{config:t.config}}getPeer(t){const n=this.builder.extensionNameMap.get(t);return n?n.getExtensionDependency():void 0}getInitDependency(t){const n=this.builder.getExtensionRep(t);return n===void 0&&Ie(315,this.extension.name,t.name),n.getExtensionInitDependency()}getDependency(t){const n=this.builder.getExtensionRep(t);return n===void 0&&Ie(315,this.extension.name,t.name),n.getExtensionDependency()}getState(){const t=this.state;return(function(n){return n.id>=ns})(t)||Ie(316,String(t.id),String(ns)),t}getDirectDependentNames(){return this.builder.incomingEdges.get(this.extension.name)||sM}getPeerNameSet(){let t=this._peerNameSet;return t||(t=new Set((this.extension.peerDependencies||[]).map(([n])=>n)),this._peerNameSet=t),t}getExtensionDependency(){if(!this._dependency){const t=this.state;(function(n){return n.id>=Wo})(t)||Ie(317,this.extension.name),this._dependency={config:t.config,init:t.initResult,output:t.output}}return this._dependency}};const sy={tag:yi};function lM(){const e=qe();e.isEmpty()&&e.append(ye())}const cM={config:{setOptions:sy,updateOptions:sy},init:({$initialEditorState:e=lM})=>({$initialEditorState:e,initialized:!1}),afterRegistration(e,{updateOptions:t,setOptions:n},r){const o=r.getInitResult();if(!o.initialized){o.initialized=!0;const{$initialEditorState:i}=o;if(fA(i))e.setEditorState(i,n);else if(typeof i=="function")e.update(()=>{i(e)},t);else if(i&&(typeof i=="string"||typeof i=="object")){const s=e.parseEditorState(i);e.setEditorState(s,n)}}return()=>{}},name:"@lexical/extension/InitialState",nodes:[zi,un,Di,ji,Io]},ay=Symbol.for("@lexical/extension/LexicalBuilder");function ly(){}function uM(e){throw e}function Ra(e){return Array.isArray(e)?e:[e]}const iu="0.39.0+prod.esm";let dM=class el{roots;extensionNameMap;outgoingConfigEdges;incomingEdges;conflicts;_sortedExtensionReps;PACKAGE_VERSION;constructor(t){this.outgoingConfigEdges=new Map,this.incomingEdges=new Map,this.extensionNameMap=new Map,this.conflicts=new Map,this.PACKAGE_VERSION=iu,this.roots=t;for(const n of t)this.addExtension(n)}static fromExtensions(t){const n=[Ra(cM)];for(const r of t)n.push(Ra(r));return new el(n)}static maybeFromEditor(t){const n=t[ay];return n&&(n.PACKAGE_VERSION!==iu&&Ie(292,n.PACKAGE_VERSION,iu),n instanceof el||Ie(293)),n}static fromEditor(t){const n=el.maybeFromEditor(t);return n===void 0&&Ie(294),n}constructEditor(){const{$initialEditorState:t,onError:n,...r}=this.buildCreateEditorArgs(),o=Object.assign(wb({...r,...n?{onError:i=>{n(i,o)}}:{}}),{[ay]:this});for(const i of this.sortedExtensionReps())i.build(o);return o}buildEditor(){let t=ly;function n(){try{t()}finally{t=ly}}const r=Object.assign(this.constructEditor(),{dispose:n,[Symbol.dispose]:n});return t=Rn(this.registerEditor(r),()=>r.setRootElement(null)),r}hasExtensionByName(t){return this.extensionNameMap.has(t)}getExtensionRep(t){const n=this.extensionNameMap.get(t.name);if(n)return n.extension!==t&&Ie(295,t.name),n}addEdge(t,n,r){const o=this.outgoingConfigEdges.get(t);o?o.set(n,r):this.outgoingConfigEdges.set(t,new Map([[n,r]]));const i=this.incomingEdges.get(n);i?i.add(t):this.incomingEdges.set(n,new Set([t]))}addExtension(t){this._sortedExtensionReps!==void 0&&Ie(296);const n=Ra(t),[r]=n;typeof r.name!="string"&&Ie(297,typeof r.name);let o=this.extensionNameMap.get(r.name);if(o!==void 0&&o.extension!==r&&Ie(298,r.name),!o){o=new aM(this,r),this.extensionNameMap.set(r.name,o);const i=this.conflicts.get(r.name);typeof i=="string"&&Ie(299,r.name,i);for(const s of r.conflictsWith||[])this.extensionNameMap.has(s)&&Ie(299,r.name,s),this.conflicts.set(s,r.name);for(const s of r.dependencies||[]){const a=Ra(s);this.addEdge(r.name,a[0].name,a.slice(1)),this.addExtension(a)}for(const[s,a]of r.peerDependencies||[])this.addEdge(r.name,s,a?[a]:[])}}sortedExtensionReps(){if(this._sortedExtensionReps)return this._sortedExtensionReps;const t=[],n=(r,o)=>{let i=r.state;if(dw(i))return;const s=r.extension.name;var a;ou(i)||Ie(300,s,o||"[unknown]"),ou(a=i)||Ie(304,String(a.id),String(Vh)),i=Object.assign(a,{id:qd}),r.state=i;const l=this.outgoingConfigEdges.get(s);if(l)for(const c of l.keys()){const u=this.extensionNameMap.get(c);u&&n(u,s)}i=iM(i),r.state=i,t.push(r)};for(const r of this.extensionNameMap.values())ou(r.state)&&n(r);for(const r of t)for(const[o,i]of this.outgoingConfigEdges.get(r.extension.name)||[])if(i.length>0){const s=this.extensionNameMap.get(o);if(s)for(const a of i)s.configs.add(a)}for(const[r,...o]of this.roots)if(o.length>0){const i=this.extensionNameMap.get(r.name);i===void 0&&Ie(301,r.name);for(const s of o)i.configs.add(s)}return this._sortedExtensionReps=t,this._sortedExtensionReps}registerEditor(t){const n=this.sortedExtensionReps(),r=new AbortController,o=[()=>r.abort()],i=r.signal;for(const s of n){const a=s.register(t,i);a&&o.push(a)}for(const s of n){const a=s.afterRegistration(t);a&&o.push(a)}return Rn(...o)}buildCreateEditorArgs(){const t={},n=new Set,r=new Map,o=new Map,i={},s={},a=this.sortedExtensionReps();for(const u of a){const{extension:f}=u;if(f.onError!==void 0&&(t.onError=f.onError),f.disableEvents!==void 0&&(t.disableEvents=f.disableEvents),f.parentEditor!==void 0&&(t.parentEditor=f.parentEditor),f.editable!==void 0&&(t.editable=f.editable),f.namespace!==void 0&&(t.namespace=f.namespace),f.$initialEditorState!==void 0&&(t.$initialEditorState=f.$initialEditorState),f.nodes)for(const d of oM(f)){if(typeof d!="function"){const h=r.get(d.replace);h&&Ie(302,f.name,d.replace.name,h.extension.name),r.set(d.replace,u)}n.add(d)}if(f.html){if(f.html.export)for(const[d,h]of f.html.export.entries())o.set(d,h);f.html.import&&Object.assign(i,f.html.import)}f.theme&&cw(s,f.theme)}Object.keys(s).length>0&&(t.theme=s),n.size&&(t.nodes=[...n]);const l=Object.keys(i).length>0,c=o.size>0;(l||c)&&(t.html={},l&&(t.html.import=i),c&&(t.html.export=o));for(const u of a)u.init(t);return t.onError||(t.onError=uM),t}},Bh=class fw extends Zs{static getType(){return"horizontalrule"}static clone(t){return new fw(t.__key)}static importJSON(t){return hw().updateFromJSON(t)}static importDOM(){return{hr:()=>({conversion:fM,priority:0})}}exportDOM(){return{element:document.createElement("hr")}}createDOM(t){const n=document.createElement("hr");return Qe(n,t.theme.hr),n}getTextContent(){return`
45
- `}isInline(){return!1}updateDOM(){return!1}};function fM(){return{node:hw()}}function hw(){return Db(Bh)}function hM(e){return e instanceof Bh}function Mr(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const o of t)r.append("v",o);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function Yd(e){let t=1,n=e.getParent();for(;n!=null;){if(ke(n)){const r=n.getParent();if(pe(r)){t++,n=r.getParent();continue}Mr(40)}return t}return t}function Xd(e){let t=e.getParent();pe(t)||Mr(40);let n=t;for(;n!==null;)n=n.getParent(),pe(n)&&(t=n);return t}function gw(e){let t=[];const n=e.getChildren().filter(ke);for(let r=0;r<n.length;r++){const o=n[r],i=o.getFirstChild();pe(i)?t=t.concat(gw(i)):t.push(o)}return t}function On(e){return ke(e)&&pe(e.getFirstChild())}function cy(e){return Gt().append(e)}function pw(e,t){return ke(e)&&(t.length===0||t.length===1&&e.is(t[0])&&e.getChildrenSize()===0)}function uy(e){const t=Y();if(t!==null){let n=t.getNodes();if(W(t)){const o=t.getStartEndPoints();o===null&&Mr(143);const[i]=o,s=i.getNode(),a=s.getParent();if(pt(s)){const l=s.getFirstChild();if(l)n=l.selectStart().getNodes();else{const c=ye();s.append(c),n=c.select().getNodes()}}else if(pw(s,n)){const l=Vt(e);if(pt(a)){s.replace(l);const c=Gt();B(s)&&(c.setFormat(s.getFormatType()),c.setIndent(s.getIndent())),l.append(c)}else if(ke(s)){const c=s.getParentOrThrow();Mo(l,c.getChildren()),c.replace(l)}return}}const r=new Set;for(let o=0;o<n.length;o++){const i=n[o];if(B(i)&&i.isEmpty()&&!ke(i)&&!r.has(i.getKey())){dy(i,e);continue}let s=Eb(i)?i.getParent():ke(i)&&i.isEmpty()?i:null;for(;s!=null;){const a=s.getKey();if(pe(s)){if(!r.has(a)){const l=Vt(e);Mo(l,s.getChildren()),s.replace(l),r.add(a)}break}{const l=s.getParent();if(pt(l)&&!r.has(a)){r.add(a),dy(s,e);break}s=l}}}}}function Mo(e,t){e.splice(e.getChildrenSize(),0,t)}function dy(e,t){if(pe(e))return e;const n=e.getPreviousSibling(),r=e.getNextSibling(),o=Gt();let i;if(Mo(o,e.getChildren()),pe(n)&&t===n.getListType())n.append(o),pe(r)&&t===r.getListType()&&(Mo(n,r.getChildren()),r.remove()),i=n;else if(pe(r)&&t===r.getListType())r.getFirstChildOrThrow().insertBefore(o),i=r;else{const s=Vt(t);s.append(o),e.replace(s),i=s}return o.setFormat(e.getFormatType()),o.setIndent(e.getIndent()),e.remove(),i}function zh(e,t){const n=e.getLastChild(),r=t.getFirstChild();n&&r&&On(n)&&On(r)&&(zh(n.getFirstChild(),r.getFirstChild()),r.remove());const o=t.getChildren();o.length>0&&e.append(...o),t.remove()}function gM(){const e=Y();if(W(e)){const t=new Set,n=e.getNodes(),r=e.anchor.getNode();if(pw(r,n))t.add(Xd(r));else for(let o=0;o<n.length;o++){const i=n[o];if(Eb(i)){const s=qA(i,Xr);s!=null&&t.add(Xd(s))}}for(const o of t){let i=o;const s=gw(o);for(const a of s){const l=ye().setTextStyle(e.style).setTextFormat(e.format);Mo(l,a.getChildren()),i.insertAfter(l),i=l,a.__key===e.anchor.key&&bn(e.anchor,Mt(Nt(l,"next"))),a.__key===e.focus.key&&bn(e.focus,Mt(Nt(l,"next"))),a.remove()}o.remove()}}}function mw(e){const t=e.getListType()!=="check";let n=e.getStart();for(const r of e.getChildren())ke(r)&&(r.getValue()!==n&&r.setValue(n),t&&r.getLatest().__checked!=null&&r.setChecked(void 0),pe(r.getFirstChild())||n++)}function pM(e){const t=new Set;if(On(e)||t.has(e.getKey()))return;const n=e.getParent(),r=e.getNextSibling(),o=e.getPreviousSibling();if(On(r)&&On(o)){const i=o.getFirstChild();if(pe(i)){i.append(e);const s=r.getFirstChild();pe(s)&&(Mo(i,s.getChildren()),r.remove(),t.add(r.getKey()))}}else if(On(r)){const i=r.getFirstChild();if(pe(i)){const s=i.getFirstChild();s!==null&&s.insertBefore(e)}}else if(On(o)){const i=o.getFirstChild();pe(i)&&i.append(e)}else if(pe(n)){const i=Gt().setTextFormat(e.getTextFormat()).setTextStyle(e.getTextStyle()),s=Vt(n.getListType()).setTextFormat(n.getTextFormat()).setTextStyle(n.getTextStyle());i.append(s),s.append(e),o?o.insertAfter(i):r?r.insertBefore(i):n.append(i)}}function mM(e){if(On(e))return;const t=e.getParent(),n=t?t.getParent():void 0;if(pe(n?n.getParent():void 0)&&ke(n)&&pe(t)){const r=t?t.getFirstChild():void 0,o=t?t.getLastChild():void 0;if(e.is(r))n.insertBefore(e),t.isEmpty()&&n.remove();else if(e.is(o))n.insertAfter(e),t.isEmpty()&&n.remove();else{const i=t.getListType(),s=Gt(),a=Vt(i);s.append(a),e.getPreviousSiblings().forEach(u=>a.append(u));const l=Gt(),c=Vt(i);l.append(c),Mo(c,e.getNextSiblings()),n.insertBefore(s),n.insertAfter(l),n.replace(e)}}}function yM(){const e=Y();if(!W(e)||!e.isCollapsed())return!1;const t=e.anchor.getNode();if(!ke(t)||t.getChildrenSize()!==0)return!1;const n=Xd(t),r=t.getParent();pe(r)||Mr(40);const o=r.getParent();let i;if(pt(o))i=ye(),n.insertAfter(i);else{if(!ke(o))return!1;i=Gt(),o.insertAfter(i)}i.setTextStyle(e.style).setTextFormat(e.format).select();const s=t.getNextSiblings();if(s.length>0){const a=Vt(r.getListType());if(ke(i)){const l=Gt();l.append(a),i.insertAfter(l)}else i.insertAfter(a);a.append(...s)}return(function(a){let l=a;for(;l.getNextSibling()==null&&l.getPreviousSibling()==null;){const c=l.getParent();if(c==null||!ke(c)&&!pe(c))break;l=c}l.remove()})(t),!0}function El(...e){const t=[];for(const n of e)if(n&&typeof n=="string")for(const[r]of n.matchAll(/\S+/g))t.push(r);return t}let Xr=class extends St{__value;__checked;$config(){return this.config("listitem",{$transform:t=>{if(t.__checked==null)return;const n=t.getParent();pe(n)&&n.getListType()!=="check"&&t.getChecked()!=null&&t.setChecked(void 0)},extends:St,importDOM:{li:()=>({conversion:vM,priority:0})}})}constructor(t=1,n=void 0,r){super(r),this.__value=t===void 0?1:t,this.__checked=n}afterCloneFrom(t){super.afterCloneFrom(t),this.__value=t.__value,this.__checked=t.__checked}createDOM(t){const n=document.createElement("li");return this.updateListItemDOM(null,n,t),n}updateListItemDOM(t,n,r){(function(s,a,l){const c=a.getParent();!pe(c)||c.getListType()!=="check"||pe(a.getFirstChild())?(s.removeAttribute("role"),s.removeAttribute("tabIndex"),s.removeAttribute("aria-checked")):(s.setAttribute("role","checkbox"),s.setAttribute("tabIndex","-1"),l&&a.__checked===l.__checked||s.setAttribute("aria-checked",a.getChecked()?"true":"false"))})(n,this,t),n.value=this.__value,(function(s,a,l){const c=[],u=[],f=a.list,d=f?f.listitem:void 0;let h;if(f&&f.nested&&(h=f.nested.listitem),d!==void 0&&c.push(...El(d)),f){const g=l.getParent(),p=pe(g)&&g.getListType()==="check",m=l.getChecked();p&&!m||u.push(f.listitemUnchecked),p&&m||u.push(f.listitemChecked),p&&c.push(m?f.listitemChecked:f.listitemUnchecked)}if(h!==void 0){const g=El(h);l.getChildren().some(p=>pe(p))?c.push(...g):u.push(...g)}u.length>0&&Un(s,...u),c.length>0&&Qe(s,...c)})(n,r.theme,this);const o=t?t.__style:"",i=this.__style;o!==i&&(i===""?n.removeAttribute("style"):n.style.cssText=i),(function(s,a,l){const c=Qm(a.__textStyle);for(const u in c)s.style.setProperty(`--listitem-marker-${u}`,c[u]);if(l)for(const u in Qm(l.__textStyle))u in c||s.style.removeProperty(`--listitem-marker-${u}`)})(n,this,t)}updateDOM(t,n,r){const o=n;return this.updateListItemDOM(t,o,r),!1}updateFromJSON(t){return super.updateFromJSON(t).setValue(t.value).setChecked(t.checked)}exportDOM(t){const n=this.createDOM(t._config),r=this.getFormatType();r&&(n.style.textAlign=r);const o=this.getDirection();return o&&(n.dir=o),{element:n}}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),value:this.getValue()}}append(...t){for(let n=0;n<t.length;n++){const r=t[n];if(B(r)&&this.canMergeWith(r)){const o=r.getChildren();this.append(...o),r.remove()}else super.append(r)}return this}replace(t,n){if(ke(t))return super.replace(t);this.setIndent(0);const r=this.getParentOrThrow();if(!pe(r))return t;if(r.__first===this.getKey())r.insertBefore(t);else if(r.__last===this.getKey())r.insertAfter(t);else{const o=Vt(r.getListType());let i=this.getNextSibling();for(;i;){const s=i;i=i.getNextSibling(),o.append(s)}r.insertAfter(t),t.insertAfter(o)}return n&&(B(t)||Mr(139),this.getChildren().forEach(o=>{t.append(o)})),this.remove(),r.getChildrenSize()===0&&r.remove(),t}insertAfter(t,n=!0){const r=this.getParentOrThrow();if(pe(r)||Mr(39),ke(t))return super.insertAfter(t,n);const o=this.getNextSiblings();if(r.insertAfter(t,n),o.length!==0){const i=Vt(r.getListType());o.forEach(s=>i.append(s)),t.insertAfter(i,n)}return t}remove(t){const n=this.getPreviousSibling(),r=this.getNextSibling();super.remove(t),n&&r&&On(n)&&On(r)&&(zh(n.getFirstChild(),r.getFirstChild()),r.remove())}insertNewAfter(t,n=!0){const r=Gt().updateFromJSON(this.exportJSON()).setChecked(!this.getChecked()&&void 0);return this.insertAfter(r,n),r}collapseAtStart(t){const n=ye();this.getChildren().forEach(s=>n.append(s));const r=this.getParentOrThrow(),o=r.getParentOrThrow(),i=ke(o);if(r.getChildrenSize()===1)if(i)r.remove(),o.select();else{r.insertBefore(n),r.remove();const s=t.anchor,a=t.focus,l=n.getKey();s.type==="element"&&s.getNode().is(this)&&s.set(l,s.offset,"element"),a.type==="element"&&a.getNode().is(this)&&a.set(l,a.offset,"element")}else r.insertBefore(n),this.remove();return!0}getValue(){return this.getLatest().__value}setValue(t){const n=this.getWritable();return n.__value=t,n}getChecked(){const t=this.getLatest();let n;const r=this.getParent();return pe(r)&&(n=r.getListType()),n==="check"?!!t.__checked:void 0}setChecked(t){const n=this.getWritable();return n.__checked=t,n}toggleChecked(){const t=this.getWritable();return t.setChecked(!t.__checked)}getIndent(){const t=this.getParent();if(t===null||!this.isAttached())return this.getLatest().__indent;let n=t.getParentOrThrow(),r=0;for(;ke(n);)n=n.getParentOrThrow().getParentOrThrow(),r++;return r}setIndent(t){typeof t!="number"&&Mr(117),(t=Math.floor(t))>=0||Mr(199);let n=this.getIndent();for(;n!==t;)n<t?(pM(this),n++):(mM(this),n--);return this}canInsertAfter(t){return ke(t)}canReplaceWith(t){return ke(t)}canMergeWith(t){return ke(t)||Yr(t)}extractWithChild(t,n){if(!W(n))return!1;const r=n.anchor.getNode(),o=n.focus.getNode();return this.isParentOf(r)&&this.isParentOf(o)&&this.getTextContent().length===n.getTextContent().length}isParentRequired(){return!0}createParentElementNode(){return Vt("bullet")}canMergeWhenEmpty(){return!0}};function vM(e){if(e.classList.contains("task-list-item")){for(const n of e.children)if(n.tagName==="INPUT")return fy(n)}if(e.classList.contains("joplin-checkbox")){for(const n of e.children)if(n.classList.contains("checkbox-wrapper")&&n.children.length>0&&n.children[0].tagName==="INPUT")return fy(n.children[0])}const t=e.getAttribute("aria-checked");return{node:Gt(t==="true"||t!=="false"&&void 0)}}function fy(e){return e.getAttribute("type")!=="checkbox"?{node:null}:{node:Gt(e.hasAttribute("checked"))}}function Gt(e){return _t(new Xr(void 0,e))}function ke(e){return e instanceof Xr}let jo=class extends St{__tag;__start;__listType;$config(){return this.config("list",{$transform:t=>{(function(n){const r=n.getNextSibling();pe(r)&&n.getListType()===r.getListType()&&zh(n,r)})(t),mw(t)},extends:St,importDOM:{ol:()=>({conversion:gy,priority:0}),ul:()=>({conversion:gy,priority:0})}})}constructor(t="number",n=1,r){super(r);const o=bM[t]||t;this.__listType=o,this.__tag=o==="number"?"ol":"ul",this.__start=n}afterCloneFrom(t){super.afterCloneFrom(t),this.__listType=t.__listType,this.__tag=t.__tag,this.__start=t.__start}getTag(){return this.getLatest().__tag}setListType(t){const n=this.getWritable();return n.__listType=t,n.__tag=t==="number"?"ol":"ul",n}getListType(){return this.getLatest().__listType}getStart(){return this.getLatest().__start}setStart(t){const n=this.getWritable();return n.__start=t,n}createDOM(t,n){const r=this.__tag,o=document.createElement(r);return this.__start!==1&&o.setAttribute("start",String(this.__start)),o.__lexicalListType=this.__listType,hy(o,t.theme,this),o}updateDOM(t,n,r){return t.__tag!==this.__tag||t.__listType!==this.__listType||(hy(n,r.theme,this),!1)}updateFromJSON(t){return super.updateFromJSON(t).setListType(t.listType).setStart(t.start)}exportDOM(t){const n=this.createDOM(t._config,t);return Be(n)&&(this.__start!==1&&n.setAttribute("start",String(this.__start)),this.__listType==="check"&&n.setAttribute("__lexicalListType","check")),{element:n}}exportJSON(){return{...super.exportJSON(),listType:this.getListType(),start:this.getStart(),tag:this.getTag()}}canBeEmpty(){return!1}canIndent(){return!1}splice(t,n,r){let o=r;for(let i=0;i<r.length;i++){const s=r[i];ke(s)||(o===r&&(o=[...r]),o[i]=Gt().append(!B(s)||pe(s)||s.isInline()?s:Fe(s.getTextContent())))}return super.splice(t,n,o)}extractWithChild(t){return ke(t)}};function hy(e,t,n){const r=[],o=[],i=t.list;if(i!==void 0){const s=i[`${n.__tag}Depth`]||[],a=Yd(n)-1,l=a%s.length,c=s[l],u=i[n.__tag];let f;const d=i.nested,h=i.checklist;if(d!==void 0&&d.list&&(f=d.list),u!==void 0&&r.push(u),h!==void 0&&n.__listType==="check"&&r.push(h),c!==void 0){r.push(...El(c));for(let g=0;g<s.length;g++)g!==l&&o.push(n.__tag+g)}if(f!==void 0){const g=El(f);a>1?r.push(...g):o.push(...g)}}o.length>0&&Un(e,...o),r.length>0&&Qe(e,...r)}function xM(e){const t=[];for(let n=0;n<e.length;n++){const r=e[n];if(ke(r)){t.push(r);const o=r.getChildren();o.length>1&&o.forEach(i=>{pe(i)&&t.push(cy(i))})}else t.push(cy(r))}return t}function gy(e){const t=e.nodeName.toLowerCase();let n=null;return t==="ol"?n=Vt("number",e.start):t==="ul"&&(n=(function(r){if(r.getAttribute("__lexicallisttype")==="check"||r.classList.contains("contains-task-list")||r.getAttribute("data-is-checklist")==="1")return!0;for(const o of r.childNodes)if(Be(o)&&o.hasAttribute("aria-checked"))return!0;return!1})(e)?Vt("check"):Vt("bullet")),{after:xM,node:n}}const bM={ol:"number",ul:"bullet"};function Vt(e="number",t=1){return _t(new jo(e,t))}function pe(e){return e instanceof jo}const wM=le("UPDATE_LIST_START_COMMAND"),yw=le("INSERT_UNORDERED_LIST_COMMAND"),vw=le("INSERT_ORDERED_LIST_COMMAND"),CM=le("REMOVE_LIST_COMMAND");function SM(e){return Rn(e.registerCommand(vw,()=>(uy("number"),!0),ar),e.registerCommand(wM,t=>{const{listNodeKey:n,newStart:r}=t,o=Le(n);return!!pe(o)&&(o.getListType()==="number"&&(o.setStart(r),mw(o)),!0)},ar),e.registerCommand(yw,()=>(uy("bullet"),!0),ar),e.registerCommand(CM,()=>(gM(),!0),ar),e.registerCommand(_o,()=>yM(),ar),e.registerNodeTransform(Xr,t=>{const n=t.getFirstChild();if(n){if(X(n)){const r=n.getStyle(),o=n.getFormat();t.getTextStyle()!==r&&t.setTextStyle(r),t.getTextFormat()!==o&&t.setTextFormat(o)}}else{const r=Y();W(r)&&(r.style!==t.getTextStyle()||r.format!==t.getTextFormat())&&r.isCollapsed()&&t.is(r.anchor.getNode())&&t.setTextStyle(r.style).setTextFormat(r.format)}}),e.registerNodeTransform(un,t=>{const n=t.getParent();if(ke(n)&&t.is(n.getFirstChild())){const r=t.getStyle(),o=t.getFormat();r===n.getTextStyle()&&o===n.getTextFormat()||n.setTextStyle(r).setTextFormat(o)}}))}function _M(e){const t=n=>{const r=n.getParent();if(pe(n.getFirstChild())||!pe(r))return;const o=we(n,i=>ke(i)&&pe(i.getParent())&&ke(i.getPreviousSibling()));if(o===null&&n.getIndent()>0)n.setIndent(0);else if(ke(o)){const i=o.getPreviousSibling();if(ke(i)){const s=(function(l){let c=l,u=c.getFirstChild();for(;pe(u);){const f=u.getLastChild();if(!ke(f))break;c=f,u=c.getFirstChild()}return c})(i),a=s.getParent();if(pe(a)){const l=Yd(a);l+1<Yd(r)&&n.setIndent(l)}}}};return e.registerNodeTransform(jo,n=>{const r=[n];for(;r.length>0;){const o=r.shift();if(pe(o)){for(const i of o.getChildren())if(ke(i)){t(i);const s=i.getFirstChild();pe(s)&&r.push(s)}}}})}function TM(e,t){const n=Tb(t)?t.body.childNodes:t.childNodes;let r=[];const o=[];for(const i of n)if(!bw.has(i.nodeName)){const s=ww(i,e,o,!1);s!==null&&(r=r.concat(s))}return(function(i){for(const s of i)s.getNextSibling()instanceof Ch&&s.insertAfter(Tn());for(const s of i){const a=s.getChildren();for(const l of a)s.insertBefore(l);s.remove()}})(o),r}function EM(e,t){if(typeof document>"u"||typeof window>"u"&&global.window===void 0)throw new Error("To use $generateHtmlFromNodes in headless mode please initialize a headless browser implementation such as JSDom before calling this function.");const n=document.createElement("div"),r=qe().getChildren();for(let o=0;o<r.length;o++)xw(e,r[o],n,t);return n.innerHTML}function xw(e,t,n,r=null){let o=r===null||t.isSelected(r);const i=B(t)&&t.excludeFromCopy("html");let s=t;r!==null&&X(t)&&(s=Gb(r,t,"clone"));const a=B(s)?s.getChildren():[],l=_h(e,s.getType());let c;c=l&&l.exportDOM!==void 0?l.exportDOM(e,s):s.exportDOM(e);const{element:u,after:f}=c;if(!u)return!1;const d=document.createDocumentFragment();for(let h=0;h<a.length;h++){const g=a[h],p=xw(e,g,d,r);!o&&B(t)&&p&&t.extractWithChild(g,r,"html")&&(o=!0)}if(o&&!i){if((Be(u)||Wd(u))&&u.append(d),n.append(u),f){const h=f.call(s,u);h&&(Wd(u)?u.replaceChildren(h):u.replaceWith(h))}}else n.append(d);return o}const bw=new Set(["STYLE","SCRIPT"]);function ww(e,t,n,r,o=new Map,i){let s=[];if(bw.has(e.nodeName))return s;let a=null;const l=(function(g,p){const{nodeName:m}=g,x=p._htmlConversions.get(m.toLowerCase());let y=null;if(x!==void 0)for(const v of x){const b=v(g);b!==null&&(y===null||(y.priority||0)<=(b.priority||0))&&(y=b)}return y!==null?y.conversion:null})(e,t),c=l?l(e):null;let u=null;if(c!==null){u=c.after;const g=c.node;if(a=Array.isArray(g)?g[g.length-1]:g,a!==null){for(const[,p]of o)if(a=p(a,i),!a)break;a&&s.push(...Array.isArray(g)?g:[a])}c.forChild!=null&&o.set(e.nodeName,c.forChild)}const f=e.childNodes;let d=[];const h=(a==null||!pt(a))&&(a!=null&&jd(a)||r);for(let g=0;g<f.length;g++)d.push(...ww(f[g],t,n,h,new Map(o),a));return u!=null&&(d=u(d)),Tl(e)&&(d=RM(e,d,h?()=>{const g=new Ch;return n.push(g),g}:ye)),a==null?d.length>0?s=s.concat(d):Tl(e)&&(function(g){return g.nextSibling==null||g.previousSibling==null?!1:Kd(g.nextSibling)&&Kd(g.previousSibling)})(e)&&(s=s.concat(Tn())):B(a)&&a.append(...d),s}function RM(e,t,n){const r=e.style.textAlign,o=[];let i=[];for(let s=0;s<t.length;s++){const a=t[s];if(jd(a))r&&!a.getFormat()&&a.setFormat(r),o.push(a);else if(i.push(a),s===t.length-1||s<t.length-1&&jd(t[s+1])){const l=n();l.setFormat(r),l.append(...i),o.push(l),i=[]}}return o}function Rl(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const o of t)r.append("v",o);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function kM(e,t=Y()){return t==null&&Rl(166),W(t)&&t.isCollapsed()||t.getNodes().length===0?"":EM(e,t)}function AM(e,t=Y()){return t==null&&Rl(166),W(t)&&t.isCollapsed()||t.getNodes().length===0?null:JSON.stringify(MM(e,t))}function py(e,t,n){const r=e.getData("application/x-lexical-editor");if(r)try{const a=JSON.parse(r);if(a.namespace===n._config.namespace&&Array.isArray(a.nodes))return my(n,NM(a.nodes),t)}catch(a){console.error(a)}const o=e.getData("text/html"),i=e.getData("text/plain");if(o&&i!==o)try{const a=new DOMParser().parseFromString((function(l){return window.trustedTypes&&window.trustedTypes.createPolicy?window.trustedTypes.createPolicy("lexical",{createHTML:c=>c}).createHTML(l):l})(o),"text/html");return my(n,TM(n,a),t)}catch(a){console.error(a)}const s=i||e.getData("text/uri-list");if(s!=null)if(W(t)){const a=s.split(/(\r?\n|\t)/);a[a.length-1]===""&&a.pop();for(let l=0;l<a.length;l++){const c=Y();if(W(c)){const u=a[l];u===`
44
+ `?r.push(kn()):s===" "?r.push(qi()):r.push(Fe(s))}this.insertNodes(r)}insertText(t){const n=this.anchor,r=this.focus,o=this.format,i=this.style;let s=n,a=r;!this.isCollapsed()&&r.isBefore(n)&&(s=r,a=n),s.type==="element"&&(function(m,v,y,x){const b=m.getNode(),w=b.getChildAtIndex(m.offset),_=Fe();if(_.setFormat(y),_.setStyle(x),Qr(w))w.splice(0,0,[_]);else{const E=at(b)?ve().append(_):_;w===null?b.append(E):w.insertBefore(E)}m.is(v)&&v.set(_.__key,0,"text"),m.set(_.__key,0,"text")})(s,a,o,i),a.type==="element"&&Sn(a,Lt(An(a,"next")));const l=s.offset;let c=a.offset;const u=this.getNodes(),f=u.length;let d=u[0];J(d)||Y(26);const h=d.getTextContent().length,g=d.getParentOrThrow();let p=u[f-1];if(f===1&&a.type==="element"&&(c=h,a.set(s.key,c,"text")),this.isCollapsed()&&l===h&&(sr(d)||!d.canInsertTextAfter()||!g.canInsertTextAfter()&&d.getNextSibling()===null)){let m=d.getNextSibling();if(J(m)&&m.canInsertTextBefore()&&!sr(m)||(m=Fe(),m.setFormat(o),m.setStyle(i),g.canInsertTextAfter()?d.insertAfter(m):g.insertAfter(m)),m.select(0,0),d=m,t!=="")return void this.insertText(t)}else if(this.isCollapsed()&&l===0&&(sr(d)||!d.canInsertTextBefore()||!g.canInsertTextBefore()&&d.getPreviousSibling()===null)){let m=d.getPreviousSibling();if(J(m)&&!sr(m)||(m=Fe(),m.setFormat(o),g.canInsertTextBefore()?d.insertBefore(m):g.insertBefore(m)),m.select(),d=m,t!=="")return void this.insertText(t)}else if(d.isSegmented()&&l!==h){const m=Fe(d.getTextContent());m.setFormat(o),d.replace(m),d=m}else if(!this.isCollapsed()&&t!==""){const m=p.getParent();if(!g.canInsertTextBefore()||!g.canInsertTextAfter()||B(m)&&(!m.canInsertTextBefore()||!m.canInsertTextAfter()))return this.insertText(""),m1(this.anchor,this.focus,null),void this.insertText(t)}if(f===1){if(Eo(d)){const x=Fe(t);return x.select(),void d.replace(x)}const m=d.getFormat(),v=d.getStyle();if(l!==c||m===o&&v===i){if(rc(d)){const x=Fe(t);return x.setFormat(o),x.setStyle(i),x.select(),void d.replace(x)}}else{if(d.getTextContent()!==""){const x=Fe(t);if(x.setFormat(o),x.setStyle(i),x.select(),l===0)d.insertBefore(x,!1);else{const[b]=d.splitText(l);b.insertAfter(x,!1)}return void(x.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=t.length))}d.setFormat(o),d.setStyle(i)}const y=c-l;d=d.spliceText(l,y,t,!0),d.getTextContent()===""?d.remove():this.anchor.type==="text"&&(d.isComposing()?this.anchor.offset-=t.length:(this.format=m,this.style=v))}else{const m=new Set([...d.getParentKeys(),...p.getParentKeys()]),v=B(d)?d:d.getParentOrThrow();let y=B(p)?p:p.getParentOrThrow(),x=p;if(!v.is(y)&&y.isInline())do x=y,y=y.getParentOrThrow();while(y.isInline());if(a.type==="text"&&(c!==0||p.getTextContent()==="")||a.type==="element"&&p.getIndexWithinParent()<c)if(J(p)&&!Eo(p)&&c!==p.getTextContentSize()){if(p.isSegmented()){const R=Fe(p.getTextContent());p.replace(R),p=R}at(a.getNode())||a.type!=="text"||(p=p.spliceText(0,c,"")),m.add(p.__key)}else{const R=p.getParentOrThrow();R.canBeEmpty()||R.getChildrenSize()!==1?p.remove():R.remove()}else m.add(p.__key);const b=y.getChildren(),w=new Set(u),_=v.is(y),E=v.isInline()&&d.getNextSibling()===null?v:d;for(let R=b.length-1;R>=0;R--){const k=b[R];if(k.is(d)||B(k)&&k.isParentOf(d))break;k.isAttached()&&(!w.has(k)||k.is(x)?_||E.insertAfter(k,!1):k.remove())}if(!_){let R=y,k=null;for(;R!==null;){const M=R.getChildren(),F=M.length;(F===0||M[F-1].is(k))&&(m.delete(R.__key),k=R),R=R.getParent()}}if(Eo(d))if(l===h)d.select();else{const R=Fe(t);R.select(),d.replace(R)}else d=d.spliceText(l,h-l,t,!0),d.getTextContent()===""?d.remove():d.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=t.length);for(let R=1;R<f;R++){const k=u[R],M=k.__key;m.has(M)||k.remove()}}}removeText(){const t=X()===this;sl(this,BA(ey(this))),t&&X()!==this&&Ge(this)}formatText(t,n=null){if(this.isCollapsed())return this.toggleFormat(t),void yt(null);const r=this.getNodes(),o=[];for(const b of r)J(b)&&o.push(b);const i=b=>{r.forEach(w=>{if(B(w)){const _=w.getFormatFlags(t,b);w.setTextFormat(_)}})},s=o.length;if(s===0)return this.toggleFormat(t),yt(null),void i(n);const a=this.anchor,l=this.focus,c=this.isBackward(),u=c?l:a,f=c?a:l;let d=0,h=o[0],g=u.type==="element"?0:u.offset;if(u.type==="text"&&g===h.getTextContentSize()&&(d=1,h=o[1],g=0),h==null)return;const p=h.getFormatFlags(t,n);i(p);const m=s-1;let v=o[m];const y=f.type==="text"?f.offset:v.getTextContentSize();if(h.is(v)){if(g===y)return;if(sr(h)||g===0&&y===h.getTextContentSize())h.setFormat(p);else{const b=h.splitText(g,y),w=g===0?b[0]:b[1];w.setFormat(p),u.type==="text"&&u.set(w.__key,0,"text"),f.type==="text"&&f.set(w.__key,y-g,"text")}return void(this.format=p)}g===0||sr(h)||([,h]=h.splitText(g),g=0),h.setFormat(p);const x=v.getFormatFlags(t,p);y>0&&(y===v.getTextContentSize()||sr(v)||([v]=v.splitText(y)),v.setFormat(x));for(let b=d+1;b<m;b++){const w=o[b],_=w.getFormatFlags(t,x);w.setFormat(_)}u.type==="text"&&u.set(h.__key,g,"text"),f.type==="text"&&f.set(v.__key,y,"text"),this.format=p|x}insertNodes(t){if(t.length===0)return;if(this.isCollapsed()||this.removeText(),this.anchor.key==="root"){this.insertParagraph();const g=X();return W(g)||Y(134),g.insertNodes(t)}const n=(this.isBackward()?this.focus:this.anchor).getNode(),r=we(n,Nr),o=t[t.length-1];if(B(r)&&"__language"in r){if("__language"in t[0])this.insertText(t[0].getTextContent());else{const g=iu(this);r.splice(g,0,t),o.selectEnd()}return}if(!t.some(g=>(B(g)||Te(g))&&!g.isInline())){B(r)||Y(211,n.constructor.name,n.getType());const g=iu(this);return r.splice(g,0,t),void o.selectEnd()}const i=(function(g){const p=ve();let m=null;for(let v=0;v<g.length;v++){const y=g[v],x=Kn(y);if(x||Te(y)&&y.isInline()||B(y)&&y.isInline()||J(y)||y.isParentRequired()){if(m===null&&(m=y.createParentElementNode(),p.append(m),x))continue;m!==null&&m.append(y)}else p.append(y),m=null}return p})(t),s=i.getLastDescendant(),a=i.getChildren(),l=!B(r)||!r.isEmpty()?this.insertParagraph():null,c=a[a.length-1];let u=a[0];var f;B(f=u)&&Nr(f)&&!f.isEmpty()&&B(r)&&(!r.isEmpty()||r.canMergeWhenEmpty())&&(B(r)||Y(211,n.constructor.name,n.getType()),r.append(...u.getChildren()),u=a[1]),u&&(r===null&&Y(212,n.constructor.name,n.getType()),(function(g,p){const m=p.getParentOrThrow().getLastChild();let v=p;const y=[p];for(;v!==m;)v.getNextSibling()||Y(140),v=v.getNextSibling(),y.push(v);let x=g;for(const b of y)x=x.insertAfter(b)})(r,u));const d=we(s,Nr);l&&B(d)&&(l.canMergeWhenEmpty()||Nr(c))&&(d.append(...l.getChildren()),l.remove()),B(r)&&r.isEmpty()&&r.remove(),s.selectEnd();const h=B(r)?r.getLastChild():null;Kn(h)&&d!==r&&h.remove()}insertParagraph(){if(this.anchor.key==="root"){const s=ve();return qe().splice(this.anchor.offset,0,[s]),s.select(),s}const t=iu(this),n=we(this.anchor.getNode(),Nr);B(n)||Y(213);const r=n.getChildAtIndex(t),o=r?[r,...r.getNextSiblings()]:[],i=n.insertNewAfter(this,!1);return i?(i.append(...o),i.selectStart(),i):null}insertLineBreak(t){const n=kn();if(this.insertNodes([n]),t){const r=n.getParentOrThrow(),o=n.getIndexWithinParent();r.select(o,o)}}extract(){const t=[...this.getNodes()],n=t.length;let r=t[0],o=t[n-1];const[i,s]=Gd(this),a=this.isBackward(),[l,c]=a?[this.focus,this.anchor]:[this.anchor,this.focus],[u,f]=a?[s,i]:[i,s];if(n===0)return[];if(n===1){if(J(r)&&!this.isCollapsed()){const d=r.splitText(u,f),h=u===0?d[0]:d[1];return h?(l.set(h.getKey(),0,"text"),c.set(h.getKey(),h.getTextContentSize(),"text"),[h]):[]}return[r]}if(J(r)&&(u===r.getTextContentSize()?t.shift():u!==0&&([,r]=r.splitText(u),t[0]=r,l.set(r.getKey(),0,"text"))),J(o)){const d=o.getTextContent().length;f===0?t.pop():f!==d&&([o]=o.splitText(f),t[t.length-1]=o,c.set(o.getKey(),o.getTextContentSize(),"text"))}return t}modify(t,n,r){if(Om(this,t,n,r))return;const o=t==="move",i=$e(),s=Ot(hn(i));if(!s)return;const a=i._blockCursorElement,l=i._rootElement,c=this.focus.getNode();if(l===null||a===null||!B(c)||c.isInline()||c.canBeEmpty()||Jd(a,i,l),this.dirty){let u=Lo(i,this.anchor.key),f=Lo(i,this.focus.key);this.anchor.type==="text"&&(u=Ii(u)),this.focus.type==="text"&&(f=Ii(f)),u&&f&&x1(s,u,this.anchor.offset,f,this.focus.offset)}if((function(u,f,d,h){u.modify(f,d,h)})(s,t,n?"backward":"forward",r),s.rangeCount>0){const u=s.getRangeAt(0),f=this.anchor.getNode(),d=at(f)?f:EA(f);if(this.applyDOMRange(u),this.dirty=!0,!o){const h=this.getNodes(),g=[];let p=!1;for(let m=0;m<h.length;m++){const v=h[m];Zd(v,d)?g.push(v):p=!0}if(p&&g.length>0)if(n){const m=g[0];B(m)?m.selectStart():m.getParentOrThrow().selectStart()}else{const m=g[g.length-1];B(m)?m.selectEnd():m.getParentOrThrow().selectEnd()}s.anchorNode===u.startContainer&&s.anchorOffset===u.startOffset||(function(m){const v=m.focus,y=m.anchor,x=y.key,b=y.offset,w=y.type;y.set(v.key,v.offset,v.type,!0),v.set(x,b,w,!0)})(this)}}r==="lineboundary"&&Om(this,t,n,r,"decorators")}forwardDeletion(t,n,r){if(!r&&(t.type==="element"&&B(n)&&t.offset===n.getChildrenSize()||t.type==="text"&&t.offset===n.getTextContentSize())){const o=n.getParent(),i=n.getNextSibling()||(o===null?null:o.getNextSibling());if(B(i)&&i.isShadowRoot())return!0}return!1}deleteCharacter(t){const n=this.isCollapsed();if(this.isCollapsed()){const r=this.anchor;let o=r.getNode();if(this.forwardDeletion(r,o,t))return;const i=Us(An(r,t?"previous":"next"));if(i.getTextSlices().every(a=>a===null||a.distance===0)){let a={type:"initial"};for(const l of i.iterNodeCarets("shadowRoot"))if(zt(l)){if(!l.origin.isInline()){if(l.origin.isShadowRoot()){if(a.type==="merge-block")break;if(B(i.anchor.origin)&&i.anchor.origin.isEmpty()){const c=Lt(l);sl(this,Kr(c,c)),i.anchor.origin.remove()}return}a.type!=="merge-next-block"&&a.type!=="merge-block"||(a={block:a.block,caret:l,type:"merge-block"})}}else{if(a.type==="merge-block")break;if(Wr(l)){if(B(l.origin)){if(l.origin.isInline()){if(!l.origin.isParentOf(i.anchor.origin))break}else a={block:l.origin,type:"merge-next-block"};continue}if(Te(l.origin)){if(!l.origin.isIsolated())if(a.type==="merge-next-block"&&(l.origin.isKeyboardSelectable()||!l.origin.isInline())&&B(i.anchor.origin)&&i.anchor.origin.isEmpty()){i.anchor.origin.remove();const c=Eh();c.add(l.origin.getKey()),Ge(c)}else l.origin.remove();return}break}}if(a.type==="merge-block"){const{caret:l,block:c}=a;return sl(this,Kr(!l.origin.isEmpty()&&c.isEmpty()?ua(nt(c,l.direction)):i.anchor,l)),this.removeText()}}const s=this.focus;if(this.modify("extend",t,"character"),this.isCollapsed()){if(t&&r.offset===0&&Nm(this,r.getNode()))return}else{const a=s.type==="text"?s.getNode():null;if(o=r.type==="text"?r.getNode():null,a!==null&&a.isSegmented()){const l=s.offset,c=a.getTextContentSize();if(a.is(o)||t&&l!==c||!t&&l!==0)return void Mm(a,t,l)}else if(o!==null&&o.isSegmented()){const l=r.offset,c=o.getTextContentSize();if(o.is(a)||t&&l!==0||!t&&l!==c)return void Mm(o,t,l)}(function(l,c){const u=l.anchor,f=l.focus,d=u.getNode(),h=f.getNode();if(d===h&&u.type==="text"&&f.type==="text"){const g=u.offset,p=f.offset,m=g<p,v=m?g:p,y=m?p:g,x=y-1;v!==x&&(function(b){return!(O1(b)||cA(b))})(d.getTextContent().slice(v,y))&&(c?f.set(f.key,x,f.type):u.set(u.key,x,u.type))}})(this,t)}}if(this.removeText(),t&&!n&&this.isCollapsed()&&this.anchor.type==="element"&&this.anchor.offset===0){const r=this.anchor.getNode();r.isEmpty()&&at(r.getParent())&&r.getPreviousSibling()===null&&Nm(this,r)}}deleteLine(t){this.isCollapsed()&&this.modify("extend",t,"lineboundary"),this.isCollapsed()?this.deleteCharacter(t):this.removeText()}deleteWord(t){if(this.isCollapsed()){const n=this.anchor,r=n.getNode();if(this.forwardDeletion(n,r,t))return;this.modify("extend",t,"word")}this.removeText()}isBackward(){return this.focus.isBefore(this.anchor)}getStartEndPoints(){return[this.anchor,this.focus]}}function Ct(e){return e instanceof oc}function Am(e){const t=e.offset;if(e.type==="text")return t;const n=e.getNode();return t===n.getChildrenSize()?n.getTextContent().length:0}function Gd(e){const t=e.getStartEndPoints();if(t===null)return[0,0];const[n,r]=t;return n.type==="element"&&r.type==="element"&&n.key===r.key&&n.offset===r.offset?[0,0]:[Am(n),Am(r)]}function Nm(e,t){for(let n=t;n;n=n.getParent()){if(B(n)){if(n.collapseAtStart(e))return!0;if(vt(n))break}if(n.getPreviousSibling())break}return!1}const cA=(()=>{try{const e=new RegExp("\\p{Emoji}","u"),t=e.test.bind(e);if(t("❤️")&&t("#️⃣")&&t("👍"))return t}catch{}return()=>!1})();function Mm(e,t,n){const r=e,o=r.getTextContent().split(/(?=\s)/g),i=o.length;let s=0,a=0;for(let c=0;c<i;c++){const u=c===i-1;if(a=s,s+=o[c].length,t&&s===n||s>n||u){o.splice(c,1),u&&(a=void 0);break}}const l=o.join("").trim();l===""?r.remove():(r.setTextContent(l),r.select(a,a))}function Pm(e,t,n,r){let o,i=t;if(Be(e)){let s=!1;const a=e.childNodes,l=a.length,c=r._blockCursorElement;i===l&&(s=!0,i=l-1);let u=a[i],f=!1;if(u===c)u=a[i+1],f=!0;else if(c!==null){const d=c.parentNode;e===d&&t>Array.prototype.indexOf.call(d.children,c)&&i--}if(o=wi(u),J(o))i=qn(o,s?"next":"previous");else{let d=wi(e);if(d===null)return null;if(B(d)){const h=r.getElementByKey(d.getKey());h===null&&Y(214),[d,i]=d.getDOMSlot(h).resolveChildIndex(d,h,e,t),B(d)||Y(215),s&&i>=d.getChildrenSize()&&(i=Math.max(0,d.getChildrenSize()-1));let p=d.getChildAtIndex(i);if(B(p)&&(function(m,v,y){const x=m.getParent();return y===null||x===null||!x.canBeEmpty()||x!==y.getNode()})(p,0,n)){const m=s?p.getLastDescendant():p.getFirstDescendant();m===null?d=p:(p=m,d=B(p)?p:p.getParentOrThrow()),i=0}J(p)?(o=p,d=null,i=qn(p,s?"next":"previous")):p!==d&&s&&!f&&(B(d)||Y(216),i=Math.min(d.getChildrenSize(),i+1))}else{const h=d.getIndexWithinParent();i=t===0&&Te(d)&&wi(e)===d?h:h+1,d=d.getParentOrThrow()}if(B(d))return Kt(d.__key,i,"element")}}else o=wi(e);return J(o)?Kt(o.__key,qn(o,i,"clamp"),"text"):null}function Lm(e,t,n){const r=e.offset,o=e.getNode();if(r===0){const i=o.getPreviousSibling(),s=o.getParent();if(t){if((n||!t)&&i===null&&B(s)&&s.isInline()){const a=s.getPreviousSibling();J(a)&&e.set(a.__key,a.getTextContent().length,"text")}}else B(i)&&!n&&i.isInline()?e.set(i.__key,i.getChildrenSize(),"element"):J(i)&&e.set(i.__key,i.getTextContent().length,"text")}else if(r===o.getTextContent().length){const i=o.getNextSibling(),s=o.getParent();if(t&&B(i)&&i.isInline())e.set(i.__key,0,"element");else if((n||t)&&i===null&&B(s)&&s.isInline()&&!s.canInsertTextAfter()){const a=s.getNextSibling();J(a)&&e.set(a.__key,0,"text")}}}function m1(e,t,n){if(e.type==="text"&&t.type==="text"){const r=e.isBefore(t),o=e.is(t);Lm(e,r,o),Lm(t,!r,o),o&&t.set(e.key,e.offset,e.type);const i=$e();if(i.isComposing()&&i._compositionKey!==e.key&&W(n)){const s=n.anchor,a=n.focus;e.set(s.key,s.offset,s.type,!0),t.set(a.key,a.offset,a.type,!0)}}}function y1(e,t,n,r,o,i){if(e===null||n===null||!aa(o,e,n))return null;const s=Pm(e,t,W(i)?i.anchor:null,o);if(s===null)return null;const a=Pm(n,r,W(i)?i.focus:null,o);if(a===null)return null;if(s.type==="element"&&a.type==="element"){const l=wi(e),c=wi(n);if(Te(l)&&Te(c))return null}return m1(s,a,i),[s,a]}function qd(e){return B(e)&&!e.isInline()}function v1(e,t,n,r,o,i){const s=Jr(),a=new Ho(Kt(e,t,o),Kt(n,r,i),0,"");return a.dirty=!0,s._selection=a,a}function ic(){const e=Kt("root",0,"element"),t=Kt("root",0,"element");return new Ho(e,t,0,"")}function Eh(){return new oc(new Set)}function uA(e,t){return sc(null,e,t,null)}function sc(e,t,n,r){const o=n._window;if(o===null)return null;const i=r||o.event,s=i?i.type:void 0,a=s==="selectionchange",l=!Nd&&(a||s==="beforeinput"||s==="compositionstart"||s==="compositionend"||s==="click"&&i&&i.detail===3||s==="drop"||s===void 0);let c,u,f,d;if(W(e)&&!l)return e.clone();if(t===null)return null;if(c=t.anchorNode,u=t.focusNode,f=t.anchorOffset,d=t.focusOffset,(a||s===void 0)&&W(e)&&!aa(n,c,u))return e.clone();const h=y1(c,f,u,d,n,e);if(h===null)return null;const[g,p]=h;return new Ho(g,p,W(e)?e.format:0,W(e)?e.style:"")}function X(){return Jr()._selection}function Zn(){return $e()._editorState._selection}function Al(e,t,n,r=1){const o=e.anchor,i=e.focus,s=o.getNode(),a=i.getNode();if(!t.is(s)&&!t.is(a))return;const l=t.__key;if(e.isCollapsed()){const c=o.offset;if(n<=c&&r>0||n<c&&r<0){const u=Math.max(0,c+r);o.set(l,u,"element"),i.set(l,u,"element"),Fm(e)}}else{const c=e.isBackward(),u=c?i:o,f=u.getNode(),d=c?o:i,h=d.getNode();if(t.is(f)){const g=u.offset;(n<=g&&r>0||n<g&&r<0)&&u.set(l,Math.max(0,g+r),"element")}if(t.is(h)){const g=d.offset;(n<=g&&r>0||n<g&&r<0)&&d.set(l,Math.max(0,g+r),"element")}}Fm(e)}function Fm(e){const t=e.anchor,n=t.offset,r=e.focus,o=r.offset,i=t.getNode(),s=r.getNode();if(e.isCollapsed()){if(!B(i))return;const a=i.getChildrenSize(),l=n>=a,c=l?i.getChildAtIndex(a-1):i.getChildAtIndex(n);if(J(c)){let u=0;l&&(u=c.getTextContentSize()),t.set(c.__key,u,"text"),r.set(c.__key,u,"text")}return}if(B(i)){const a=i.getChildrenSize(),l=n>=a,c=l?i.getChildAtIndex(a-1):i.getChildAtIndex(n);if(J(c)){let u=0;l&&(u=c.getTextContentSize()),t.set(c.__key,u,"text")}}if(B(s)){const a=s.getChildrenSize(),l=o>=a,c=l?s.getChildAtIndex(a-1):s.getChildAtIndex(o);if(J(c)){let u=0;l&&(u=c.getTextContentSize()),r.set(c.__key,u,"text")}}}function Nl(e,t,n,r,o){let i=null,s=0,a=null;r!==null?(i=r.__key,J(r)?(s=r.getTextContentSize(),a="text"):B(r)&&(s=r.getChildrenSize(),a="element")):o!==null&&(i=o.__key,J(o)?a="text":B(o)&&(a="element")),i!==null&&a!==null?e.set(i,s,a):(s=t.getIndexWithinParent(),s===-1&&(s=n.getChildrenSize()),e.set(n.__key,s,"element"))}function $m(e,t,n,r,o){e.type==="text"?e.set(n,e.offset+(t?0:o),"text"):e.offset>r.getIndexWithinParent()&&e.set(e.key,e.offset-1,"element")}function x1(e,t,n,r,o){try{e.setBaseAndExtent(t,n,r,o)}catch{}}function dA(e,t,n,r,o,i,s){const a=r.anchorNode,l=r.focusNode,c=r.anchorOffset,u=r.focusOffset,f=document.activeElement;if(o.has(h1)&&f!==i||f!==null&&Lh(f))return;if(!W(t))return void(e!==null&&aa(n,a,l)&&r.removeAllRanges());const d=t.anchor,h=t.focus,g=d.key,p=h.key,m=Lo(n,g),v=Lo(n,p),y=d.offset,x=h.offset,b=t.format,w=t.style,_=t.isCollapsed();let E=m,R=v,k=!1;if(d.type==="text"){E=Ii(m);const $=d.getNode();k=$.getFormat()!==b||$.getStyle()!==w}else W(e)&&e.anchor.type==="text"&&(k=!0);var M,F,D,j,I;if(h.type==="text"&&(R=Ii(v)),E!==null&&R!==null&&(_&&(e===null||k||W(e)&&(e.format!==b||e.style!==w))&&(M=b,F=w,D=y,j=g,I=performance.now(),s1=[M,F,D,j,I]),c!==y||u!==x||a!==E||l!==R||r.type==="Range"&&_||(f!==null&&i.contains(f)||o.has(tA)||i.focus({preventScroll:!0}),d.type==="element"))){if(x1(r,E,y,R,x),!o.has(Q3)&&t.isCollapsed()&&i!==null&&i===document.activeElement){const $=W(t)&&t.anchor.type==="element"?E.childNodes[y]||null:r.rangeCount>0?r.getRangeAt(0):null;if($!==null){let H;if($ instanceof Text){const O=document.createRange();O.selectNode($),H=O.getBoundingClientRect()}else H=$.getBoundingClientRect();(function(O,P,K){const G=V1(K),re=jh(G);if(G===null||re===null)return;let{top:U,bottom:Z}=P,Q=0,ne=0,oe=K;for(;oe!==null;){const me=oe===G.body;if(me)Q=0,ne=hn(O).innerHeight;else{const xe=oe.getBoundingClientRect();Q=xe.top,ne=xe.bottom}let ee=0;if(U<Q?ee=-(Q-U):Z>ne&&(ee=Z-ne),ee!==0)if(me)re.scrollBy(0,ee);else{const xe=oe.scrollTop;oe.scrollTop+=ee;const Se=oe.scrollTop-xe;U-=Se,Z-=Se}if(me)break;oe=la(oe)}})(n,H,i)}}zd=!0}}function Rh(e){let t=X()||Zn();t===null&&(t=qe().selectEnd()),t.insertNodes(e)}function iu(e){let t=e;e.isCollapsed()||t.removeText();const n=X();W(n)&&(t=n),W(t)||Y(161);const r=t.anchor;let o=r.getNode(),i=r.offset;for(;!Nr(o);){const s=o;if([o,i]=fA(o,i),s.is(o))break}return i}function fA(e,t){const n=e.getParent();if(!n){const o=ve();return qe().append(o),o.select(),[qe(),0]}if(J(e)){const o=e.splitText(t);if(o.length===0)return[n,e.getIndexWithinParent()];const i=t===0?0:1;return[n,o[0].getIndexWithinParent()+i]}if(!B(e)||t===0)return[n,e.getIndexWithinParent()];const r=e.getChildAtIndex(t);if(r){const o=new Ho(Kt(e.__key,t,"element"),Kt(e.__key,t,"element"),0,""),i=e.insertNewAfter(o);i&&i.append(r,...r.getNextSiblings())}return[n,e.getIndexWithinParent()+1]}function Om(e,t,n,r,o="decorators-and-blocks"){if(t==="move"&&r==="character"&&!e.isCollapsed()){const[u,f]=n===e.isBackward()?[e.focus,e.anchor]:[e.anchor,e.focus];return f.set(u.key,u.offset,u.type),!0}const i=An(e.focus,n?"previous":"next"),s=r==="lineboundary",a=t==="move";let l=i,c=o==="decorators-and-blocks";if(!Kh(l)){for(const u of l){c=!1;const{origin:f}=u;if(!Te(f)||f.isIsolated()||(l=u,!s||!f.isInline()))break}if(c)for(const u of Us(i).iterNodeCarets(t==="extend"?"shadowRoot":"root")){if(zt(u))u.origin.isInline()||(l=u);else{if(B(u.origin))continue;Te(u.origin)&&!u.origin.isInline()&&(l=u)}break}}if(l===i)return!1;if(a&&!s&&Te(l.origin)&&l.origin.isKeyboardSelectable()){const u=Eh();return u.add(l.origin.getKey()),Ge(u),!0}return l=Lt(l),a&&Sn(e.anchor,l),Sn(e.focus,l),c||!s}let ht=null,gt=null,Bt=!1,su=!1,ol=0;const Im={characterData:!0,childList:!0,subtree:!0};function Yi(){return Bt||ht!==null&&ht._readOnly}function ft(){Bt&&Y(13)}function b1(){ol>99&&Y(14)}function Jr(){return ht===null&&Y(195,w1()),ht}function $e(){return gt===null&&Y(196,w1()),gt}function w1(){let e=0;const t=new Set,n=Oi.version;if(typeof window<"u")for(const o of document.querySelectorAll("[contenteditable]")){const i=lc(o);if(Fh(i))e++;else if(i){let s=String(i.constructor.version||"<0.17.1");s===n&&(s+=" (separately built, likely a bundler configuration issue)"),t.add(s)}}let r=` Detected on the page: ${e} compatible editor(s) with version ${n}`;return t.size&&(r+=` and incompatible editors with versions ${Array.from(t).join(", ")}`),r}function hA(){return gt}function Dm(e,t,n){const r=t.__type,o=R1(e,r);let i=n.get(r);i===void 0&&(i=Array.from(o.transforms),n.set(r,i));const s=i.length;for(let a=0;a<s&&(i[a](t),t.isAttached());a++);}function jm(e,t){return e!==void 0&&e.__key!==t&&e.isAttached()}function C1(e,t){if(!t)return;const n=e._updateTags;let r=t;Array.isArray(t)||(r=[t]);for(const o of r)n.add(o)}function gA(e){return kh(e,$e()._nodes)}function kh(e,t){const n=e.type,r=t.get(n);r===void 0&&Y(17,n);const o=r.klass;e.type!==o.getType()&&Y(18,o.name);const i=o.importJSON(e),s=e.children;if(B(i)&&Array.isArray(s))for(let a=0;a<s.length;a++){const l=kh(s[a],t);i.append(l)}return i}function Vm(e,t,n){const r=ht,o=Bt,i=gt;ht=t,Bt=!0,gt=e;try{return n()}finally{ht=r,Bt=o,gt=i}}function cr(e,t){const n=e._pendingEditorState,r=e._rootElement,o=e._headless||r===null;if(n===null)return;const i=e._editorState,s=i._selection,a=n._selection,l=e._dirtyType!==0,c=ht,u=Bt,f=gt,d=e._updating,h=e._observer;let g=null;if(e._pendingEditorState=null,e._editorState=n,!o&&l&&h!==null){gt=e,ht=n,Bt=!1,e._updating=!0;try{const _=e._dirtyType,E=e._dirtyElements,R=e._dirtyLeaves;h.disconnect(),g=I3(i,n,e,_,E,R)}catch(_){if(_ instanceof Error&&e._onError(_),su)throw _;return T1(e,null,r,n),Ib(e),e._dirtyType=2,su=!0,cr(e,i),void(su=!1)}finally{h.observe(r,Im),e._updating=d,ht=c,Bt=u,gt=f}}n._readOnly||(n._readOnly=!0);const p=e._dirtyLeaves,m=e._dirtyElements,v=e._normalizedNodes,y=e._updateTags,x=e._deferred;l&&(e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements=new Map,e._normalizedNodes=new Set,e._updateTags=new Set),(function(_,E){const R=_._decorators;let k=_._pendingDecorators||R;const M=E._nodeMap;let F;for(F in k)M.has(F)||(k===R&&(k=F1(_)),delete k[F])})(e,n);const b=o?null:Ot(hn(e));if(e._editable&&b!==null&&(l||a===null||a.dirty||!a.is(s))&&r!==null&&!y.has(eA)){gt=e,ht=n;try{if(h!==null&&h.disconnect(),l||a===null||a.dirty){const _=e._blockCursorElement;_!==null&&Jd(_,e,r),dA(s,a,e,b,y,r)}(function(_,E,R){let k=_._blockCursorElement;if(W(R)&&R.isCollapsed()&&R.anchor.type==="element"&&E.contains(document.activeElement)){const M=R.anchor,F=M.getNode(),D=M.offset;let j=!1,I=null;if(D===F.getChildrenSize())lu(F.getChildAtIndex(D-1))&&(j=!0);else{const $=F.getChildAtIndex(D);if($!==null&&lu($)){const H=$.getPreviousSibling();(H===null||lu(H))&&(j=!0,I=_.getElementByKey($.__key))}}if(j){const $=_.getElementByKey(F.__key);return k===null&&(_._blockCursorElement=k=(function(H){const O=H.theme,P=document.createElement("div");P.contentEditable="false",P.setAttribute("data-lexical-cursor","true");let K=O.blockCursor;if(K!==void 0){if(typeof K=="string"){const G=Pb(K);K=O.blockCursor=G}K!==void 0&&P.classList.add(...K)}return P})(_._config)),E.style.caretColor="transparent",void(I===null?$.appendChild(k):$.insertBefore(k,I))}}k!==null&&Jd(k,_,E)})(e,r,a)}finally{h!==null&&h.observe(r,Im),gt=f,ht=c}}g!==null&&(function(_,E,R,k,M){const F=Array.from(_._listeners.mutation),D=F.length;for(let j=0;j<D;j++){const[I,$]=F[j];for(const H of $){const O=E.get(H);O!==void 0&&I(O,{dirtyLeaves:k,prevEditorState:M,updateTags:R})}}})(e,g,y,p,i),W(a)||a===null||s!==null&&s.is(a)||e.dispatchCommand(fr,void 0);const w=e._pendingDecorators;w!==null&&(e._decorators=w,e._pendingDecorators=null,As("decorator",e,!0,w)),(function(_,E,R){const k=Wm(E),M=Wm(R);k!==M&&As("textcontent",_,!0,M)})(e,t||i,n),As("update",e,!0,{dirtyElements:m,dirtyLeaves:p,editorState:n,mutatedNodes:g,normalizedNodes:v,prevEditorState:t||i,tags:y}),(function(_,E){if(_._deferred=[],E.length!==0){const R=_._updating;_._updating=!0;try{for(let k=0;k<E.length;k++)E[k]()}finally{_._updating=R}}})(e,x),(function(_){const E=_._updates;if(E.length!==0){const R=E.shift();if(R){const[k,M]=R;ac(_,k,M)}}})(e)}function As(e,t,n,...r){const o=t._updating;t._updating=n;try{const i=Array.from(t._listeners[e]);for(let s=0;s<i.length;s++)i[s].apply(null,r)}finally{t._updating=o}}function Bm(e,t){const n=e._updates;let r=t||!1;for(;n.length!==0;){const o=n.shift();if(o){const[i,s]=o,a=e._pendingEditorState;let l;s!==void 0&&(l=s.onUpdate,s.skipTransforms&&(r=!0),s.discrete&&(a===null&&Y(191),a._flushSync=!0),l&&e._deferred.push(l),C1(e,s.tag)),a==null?ac(e,i,s):i()}}return r}function ac(e,t,n){const r=e._updateTags;let o,i=!1,s=!1;n!==void 0&&(o=n.onUpdate,C1(e,n.tag),i=n.skipTransforms||!1,s=n.discrete||!1),o&&e._deferred.push(o);const a=e._editorState;let l=e._pendingEditorState,c=!1;(l===null||l._readOnly)&&(l=e._pendingEditorState=S1(l||a),c=!0),l._flushSync=s;const u=ht,f=Bt,d=gt,h=e._updating;ht=l,Bt=!1,e._updating=!0,gt=e;const g=e._headless||e.getRootElement()===null;Mh(null);try{c&&(g?a._selection!==null&&(l._selection=a._selection.clone()):l._selection=(function(y,x){const b=y.getEditorState()._selection,w=Ot(hn(y));return W(b)||b==null?sc(b,w,y,x):b.clone()})(e,n&&n.event||null));const m=e._compositionKey;t(),i=Bm(e,i),(function(y,x){const b=x.getEditorState()._selection,w=y._selection;if(W(w)){const _=w.anchor,E=w.focus;let R;if(_.type==="text"&&(R=_.getNode(),R.selectionTransform(b,w)),E.type==="text"){const k=E.getNode();R!==k&&k.selectionTransform(b,w)}}})(l,e),e._dirtyType!==0&&(i?(function(y,x){const b=x._dirtyLeaves,w=y._nodeMap;for(const _ of b){const E=w.get(_);J(E)&&E.isAttached()&&E.isSimpleText()&&!E.isUnmergeable()&&ym(E)}})(l,e):(function(y,x){const b=x._dirtyLeaves,w=x._dirtyElements,_=y._nodeMap,E=Mr(),R=new Map;let k=b,M=k.size,F=w,D=F.size;for(;M>0||D>0;){if(M>0){x._dirtyLeaves=new Set;for(const j of k){const I=_.get(j);J(I)&&I.isAttached()&&I.isSimpleText()&&!I.isUnmergeable()&&ym(I),I!==void 0&&jm(I,E)&&Dm(x,I,R),b.add(j)}if(k=x._dirtyLeaves,M=k.size,M>0){ol++;continue}}x._dirtyLeaves=new Set,x._dirtyElements=new Map,F.delete("root")&&F.set("root",!0);for(const j of F){const I=j[0],$=j[1];if(w.set(I,$),!$)continue;const H=_.get(I);H!==void 0&&jm(H,E)&&Dm(x,H,R)}k=x._dirtyLeaves,M=k.size,F=x._dirtyElements,D=F.size,ol++}x._dirtyLeaves=b,x._dirtyElements=w})(l,e),Bm(e),(function(y,x,b,w){const _=y._nodeMap,E=x._nodeMap,R=[];for(const[k]of w){const M=E.get(k);M!==void 0&&(M.isAttached()||(B(M)&&Fb(M,k,_,E,R,w),_.has(k)||w.delete(k),R.push(k)))}for(const k of R)E.delete(k);for(const k of b){const M=E.get(k);M===void 0||M.isAttached()||(_.has(k)||b.delete(k),E.delete(k))}})(a,l,e._dirtyLeaves,e._dirtyElements)),m!==e._compositionKey&&(l._flushSync=!0);const v=l._selection;if(W(v)){const y=l._nodeMap,x=v.anchor.key,b=v.focus.key;y.get(x)!==void 0&&y.get(b)!==void 0||Y(19)}else Ct(v)&&v._nodes.size===0&&(l._selection=null)}catch(m){return m instanceof Error&&e._onError(m),e._pendingEditorState=a,e._dirtyType=2,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),void cr(e)}finally{ht=u,Bt=f,gt=d,e._updating=h,ol=0}e._dirtyType!==0||e._deferred.length>0||(function(m,v){const y=v.getEditorState()._selection,x=m._selection;if(x!==null){if(x.dirty||!x.is(y))return!0}else if(y!==null)return!0;return!1})(l,e)?l._flushSync?(l._flushSync=!1,cr(e)):c&&bA(()=>{cr(e)}):(l._flushSync=!1,c&&(r.clear(),e._deferred=[],e._pendingEditorState=null))}function Un(e,t,n){gt===e&&n===void 0?t():ac(e,t,n)}class Ns{element;before;after;constructor(t,n,r){this.element=t,this.before=n||null,this.after=r||null}withBefore(t){return new Ns(this.element,t,this.after)}withAfter(t){return new Ns(this.element,this.before,t)}withElement(t){return this.element===t?this:new Ns(t,this.before,this.after)}insertChild(t){const n=this.before||this.getManagedLineBreak();return n!==null&&n.parentElement!==this.element&&Y(222),this.element.insertBefore(t,n),this}removeChild(t){return t.parentElement!==this.element&&Y(223),this.element.removeChild(t),this}replaceChild(t,n){return n.parentElement!==this.element&&Y(224),this.element.replaceChild(t,n),this}getFirstChild(){const t=this.after?this.after.nextSibling:this.element.firstChild;return t===this.before||t===this.getManagedLineBreak()?null:t}getManagedLineBreak(){return this.element.__lexicalLineBreak||null}setManagedLineBreak(t){if(t===null)this.removeManagedLineBreak();else{const n=t==="decorator"&&(oa||Ki||ra);this.insertManagedLineBreak(n)}}removeManagedLineBreak(){const t=this.getManagedLineBreak();if(t){const n=this.element,r=t.nodeName==="IMG"?t.nextSibling:null;r&&n.removeChild(r),n.removeChild(t),n.__lexicalLineBreak=void 0}}insertManagedLineBreak(t){const n=this.getManagedLineBreak();if(n){if(t===(n.nodeName==="IMG"))return;this.removeManagedLineBreak()}const r=this.element,o=this.before,i=document.createElement("br");if(r.insertBefore(i,o),t){const s=document.createElement("img");s.setAttribute("data-lexical-linebreak","true"),s.style.cssText="display: inline !important; border: 0px !important; margin: 0px !important;",s.alt="",r.insertBefore(s,i),r.__lexicalLineBreak=s}else r.__lexicalLineBreak=i}getFirstChildOffset(){let t=0;for(let n=this.after;n!==null;n=n.previousSibling)t++;return t}resolveChildIndex(t,n,r,o){if(r===this.element){const l=this.getFirstChildOffset();return[t,Math.min(l+t.getChildrenSize(),Math.max(l,o))]}const i=zm(n,r);i.push(o);const s=zm(n,this.element);let a=t.getIndexWithinParent();for(let l=0;l<s.length;l++){const c=i[l],u=s[l];if(c===void 0||c<u)break;if(c>u){a+=1;break}}return[t.getParentOrThrow(),a]}}function zm(e,t){const n=[];let r=t;for(;r!==e&&r!==null;r=r.parentNode){let o=0;for(let i=r.previousSibling;i!==null;i=i.previousSibling)o++;n.push(o)}return r!==e&&Y(225),n.reverse()}class Tt extends Wn{__first;__last;__size;__format;__style;__indent;__dir;__textFormat;__textStyle;constructor(t){super(t),this.__first=null,this.__last=null,this.__size=0,this.__format=0,this.__style="",this.__indent=0,this.__dir=null,this.__textFormat=0,this.__textStyle=""}afterCloneFrom(t){super.afterCloneFrom(t),this.__key===t.__key&&(this.__first=t.__first,this.__last=t.__last,this.__size=t.__size),this.__indent=t.__indent,this.__format=t.__format,this.__style=t.__style,this.__dir=t.__dir,this.__textFormat=t.__textFormat,this.__textStyle=t.__textStyle}getFormat(){return this.getLatest().__format}getFormatType(){const t=this.getFormat();return S3[t]||""}getStyle(){return this.getLatest().__style}getIndent(){return this.getLatest().__indent}getChildren(){const t=[];let n=this.getFirstChild();for(;n!==null;)t.push(n),n=n.getNextSibling();return t}getChildrenKeys(){const t=[];let n=this.getFirstChild();for(;n!==null;)t.push(n.__key),n=n.getNextSibling();return t}getChildrenSize(){return this.getLatest().__size}isEmpty(){return this.getChildrenSize()===0}isDirty(){const t=$e()._dirtyElements;return t!==null&&t.has(this.__key)}isLastChild(){const t=this.getLatest(),n=this.getParentOrThrow().getLastChild();return n!==null&&n.is(t)}getAllTextNodes(){const t=[];let n=this.getFirstChild();for(;n!==null;){if(J(n)&&t.push(n),B(n)){const r=n.getAllTextNodes();t.push(...r)}n=n.getNextSibling()}return t}getFirstDescendant(){let t=this.getFirstChild();for(;B(t);){const n=t.getFirstChild();if(n===null)break;t=n}return t}getLastDescendant(){let t=this.getLastChild();for(;B(t);){const n=t.getLastChild();if(n===null)break;t=n}return t}getDescendantByIndex(t){const n=this.getChildren(),r=n.length;if(t>=r){const i=n[r-1];return B(i)&&i.getLastDescendant()||i||null}const o=n[t];return B(o)&&o.getFirstDescendant()||o||null}getFirstChild(){const t=this.getLatest().__first;return t===null?null:Pe(t)}getFirstChildOrThrow(){const t=this.getFirstChild();return t===null&&Y(45,this.__key),t}getLastChild(){const t=this.getLatest().__last;return t===null?null:Pe(t)}getLastChildOrThrow(){const t=this.getLastChild();return t===null&&Y(96,this.__key),t}getChildAtIndex(t){const n=this.getChildrenSize();let r,o;if(t<n/2){for(r=this.getFirstChild(),o=0;r!==null&&o<=t;){if(o===t)return r;r=r.getNextSibling(),o++}return null}for(r=this.getLastChild(),o=n-1;r!==null&&o>=t;){if(o===t)return r;r=r.getPreviousSibling(),o--}return null}getTextContent(){let t="";const n=this.getChildren(),r=n.length;for(let o=0;o<r;o++){const i=n[o];t+=i.getTextContent(),B(i)&&o!==r-1&&!i.isInline()&&(t+=zr)}return t}getTextContentSize(){let t=0;const n=this.getChildren(),r=n.length;for(let o=0;o<r;o++){const i=n[o];t+=i.getTextContentSize(),B(i)&&o!==r-1&&!i.isInline()&&(t+=2)}return t}getDirection(){return this.getLatest().__dir}getTextFormat(){return this.getLatest().__textFormat}hasFormat(t){if(t!==""){const n=cm[t];return(this.getFormat()&n)!==0}return!1}hasTextFormat(t){const n=Hr[t];return(this.getTextFormat()&n)!==0}getFormatFlags(t,n){return Ml(this.getLatest().__textFormat,t,n)}getTextStyle(){return this.getLatest().__textStyle}select(t,n){ft();const r=X();let o=t,i=n;const s=this.getChildrenSize();if(!this.canBeEmpty()){if(t===0&&n===0){const l=this.getFirstChild();if(J(l)||B(l))return l.select(0,0)}else if(!(t!==void 0&&t!==s||n!==void 0&&n!==s)){const l=this.getLastChild();if(J(l)||B(l))return l.select()}}o===void 0&&(o=s),i===void 0&&(i=s);const a=this.__key;return W(r)?(r.anchor.set(a,o,"element"),r.focus.set(a,i,"element"),r.dirty=!0,r):v1(a,o,a,i,"element","element")}selectStart(){const t=this.getFirstDescendant();return t?t.selectStart():this.select()}selectEnd(){const t=this.getLastDescendant();return t?t.selectEnd():this.select()}clear(){const t=this.getWritable();return this.getChildren().forEach(n=>n.remove()),t}append(...t){return this.splice(this.getChildrenSize(),0,t)}setDirection(t){const n=this.getWritable();return n.__dir=t,n}setFormat(t){return this.getWritable().__format=t!==""?cm[t]:0,this}setStyle(t){return this.getWritable().__style=t||"",this}setTextFormat(t){const n=this.getWritable();return n.__textFormat=t,n}setTextStyle(t){const n=this.getWritable();return n.__textStyle=t,n}setIndent(t){return this.getWritable().__indent=t,this}splice(t,n,r){kl(this)&&Y(324,this.__key,this.__type);const o=this.getChildrenSize(),i=this.getWritable();t+n<=o||Y(226,String(t),String(n),String(o));const s=i.__key,a=[],l=[],c=this.getChildAtIndex(t+n);let u=null,f=o-n+r.length;if(t!==0)if(t===o)u=this.getLastChild();else{const h=this.getChildAtIndex(t);h!==null&&(u=h.getPreviousSibling())}if(n>0){let h=u===null?this.getFirstChild():u.getNextSibling();for(let g=0;g<n;g++){h===null&&Y(100);const p=h.getNextSibling(),m=h.__key;Ro(h.getWritable()),l.push(m),h=p}}let d=u;for(const h of r){d!==null&&h.is(d)&&(u=d=d.getPreviousSibling());const g=h.getWritable();g.__parent===s&&f--,Ro(g);const p=h.__key;if(d===null)i.__first=p,g.__prev=null;else{const m=d.getWritable();m.__next=p,g.__prev=m.__key}h.__key===s&&Y(76),g.__parent=s,a.push(p),d=h}if(t+n===o)d!==null&&(d.getWritable().__next=null,i.__last=d.__key);else if(c!==null){const h=c.getWritable();if(d!==null){const g=d.getWritable();h.__prev=d.__key,g.__next=c.__key}else h.__prev=null}if(i.__size=f,l.length){const h=X();if(W(h)){const g=new Set(l),p=new Set(a),{anchor:m,focus:v}=h;Hm(m,g,p)&&Nl(m,m.getNode(),this,u,c),Hm(v,g,p)&&Nl(v,v.getNode(),this,u,c),f!==0||this.canBeEmpty()||vt(this)||this.remove()}}return i}getDOMSlot(t){return new Ns(t)}exportDOM(t){const{element:n}=super.exportDOM(t);if(Be(n)){const r=this.getIndent();r>0&&(n.style.paddingInlineStart=40*r+"px");const o=this.getDirection();o&&(n.dir=o)}return{element:n}}exportJSON(){const t={children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),...super.exportJSON()},n=this.getTextFormat(),r=this.getTextStyle();return n===0&&r===""||vt(this)||this.getChildren().some(J)||(n!==0&&(t.textFormat=n),r!==""&&(t.textStyle=r)),t}updateFromJSON(t){return super.updateFromJSON(t).setFormat(t.format).setIndent(t.indent).setDirection(t.direction).setTextFormat(t.textFormat||0).setTextStyle(t.textStyle||"")}insertNewAfter(t,n){return null}canIndent(){return!0}collapseAtStart(t){return!1}excludeFromCopy(t){return!1}canReplaceWith(t){return!0}canInsertAfter(t){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(t){return!1}extractWithChild(t,n,r){return!1}canMergeWhenEmpty(){return!1}reconcileObservedMutation(t,n){const r=this.getDOMSlot(t);let o=r.getFirstChild();for(let i=this.getFirstChild();i;i=i.getNextSibling()){const s=n.getElementByKey(i.getKey());s!==null&&(o==null?(r.insertChild(s),o=s):o!==s&&r.replaceChild(s,o),o=o.nextSibling)}}}function B(e){return e instanceof Tt}function Hm(e,t,n){let r=e.getNode();for(;r;){const o=r.__key;if(t.has(o)&&!n.has(o))return!0;r=r.getParent()}return!1}class ia extends Wn{decorate(t,n){return null}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function Te(e){return e instanceof ia}class Xi extends Tt{__cachedText;static getType(){return"root"}static clone(){return new Xi}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){Y(51)}getTextContent(){const t=this.__cachedText;return!Yi()&&$e()._dirtyType!==0||t===null?super.getTextContent():t}remove(){Y(52)}replace(t){Y(53)}insertBefore(t){Y(54)}insertAfter(t){Y(55)}updateDOM(t,n){return!1}splice(t,n,r){for(const o of r)B(o)||Te(o)||Y(282);return super.splice(t,n,r)}static importJSON(t){return qe().updateFromJSON(t)}collapseAtStart(){return!0}}function at(e){return e instanceof Xi}function S1(e){return new sa(new Map(e._nodeMap))}function Ah(){return new sa(new Map([["root",new Xi]]))}function _1(e){const t=e.exportJSON(),n=e.constructor;if(t.type!==n.getType()&&Y(130,n.name),B(e)){const r=t.children;Array.isArray(r)||Y(59,n.name);const o=e.getChildren();for(let i=0;i<o.length;i++){const s=_1(o[i]);r.push(s)}}return t}function pA(e){return e instanceof sa}class sa{_nodeMap;_selection;_flushSync;_readOnly;constructor(t,n){this._nodeMap=t,this._selection=n||null,this._flushSync=!1,this._readOnly=!1}isEmpty(){return this._nodeMap.size===1&&this._selection===null}read(t,n){return Vm(n&&n.editor||null,this,t)}clone(t){const n=new sa(this._nodeMap,t===void 0?this._selection:t);return n._readOnly=!0,n}toJSON(){return Vm(null,this,()=>({root:_1(qe())}))}}class Nh extends Tt{static getType(){return"artificial"}createDOM(t){return document.createElement("div")}}class Wo extends Tt{static getType(){return"paragraph"}static clone(t){return new Wo(t.__key)}createDOM(t){const n=document.createElement("p"),r=Ri(t.theme,"paragraph");return r!==void 0&&n.classList.add(...r),n}updateDOM(t,n,r){return!1}static importDOM(){return{p:t=>({conversion:mA,priority:0})}}exportDOM(t){const{element:n}=super.exportDOM(t);if(Be(n)){this.isEmpty()&&n.append(document.createElement("br"));const r=this.getFormatType();r&&(n.style.textAlign=r)}return{element:n}}static importJSON(t){return ve().updateFromJSON(t)}exportJSON(){const t=super.exportJSON();if(t.textFormat===void 0||t.textStyle===void 0){const n=this.getChildren().find(J);n?(t.textFormat=n.getFormat(),t.textStyle=n.getStyle()):(t.textFormat=this.getTextFormat(),t.textStyle=this.getTextStyle())}return t}insertNewAfter(t,n){const r=ve();r.setTextFormat(t.format),r.setTextStyle(t.style);const o=this.getDirection();return r.setDirection(o),r.setFormat(this.getFormatType()),r.setStyle(this.getStyle()),this.insertAfter(r,n),r}collapseAtStart(){const t=this.getChildren();if(t.length===0||J(t[0])&&t[0].getTextContent().trim()===""){if(this.getNextSibling()!==null)return this.selectNext(),this.remove(),!0;if(this.getPreviousSibling()!==null)return this.selectPrevious(),this.remove(),!0}return!1}}function mA(e){const t=ve();return e.style&&(t.setFormat(e.style.textAlign),Vh(e,t)),{node:t}}function ve(){return Et(new Wo)}function Qr(e){return e instanceof Wo}const be=0,ur=1,Dt=3,yA=4;function T1(e,t,n,r){const o=e._keyToDOMMap;o.clear(),e._editorState=Ah(),e._pendingEditorState=r,e._compositionKey=null,e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),e._normalizedNodes=new Set,e._updateTags=new Set,e._updates=[],e._blockCursorElement=null;const i=e._observer;i!==null&&(i.disconnect(),e._observer=null),t!==null&&(t.textContent=""),n!==null&&(n.textContent="",o.set("root",n))}function vA(e){const t=new Set,n=new Set;let r=e;for(;r;){const{ownNodeConfig:o}=dc(r),i=r.transform;if(!n.has(i)){n.add(i);const s=r.transform();s&&t.add(s)}if(o){const s=o.$transform;s&&t.add(s),r=o.extends}else{const s=Object.getPrototypeOf(r);r=s.prototype instanceof Wn&&s!==Wn?s:void 0}}return t}function E1(e){const t=e||{},n=hA(),r=t.theme||{},o=e===void 0?n:t.parentEditor||null,i=t.disableEvents||!1,s=Ah(),a=t.namespace||(o!==null?o._config.namespace:I1()),l=t.editorState,c=[Xi,fn,Ui,Gi,Wo,Nh,...t.nodes||[]],{onError:u,html:f}=t,d=t.editable===void 0||t.editable;let h;if(e===void 0&&n!==null)h=n._nodes;else{h=new Map;for(let p=0;p<c.length;p++){let m=c[p],v=null,y=null;if(typeof m!="function"){const w=m;m=w.replace,v=w.with,y=w.withKlass||null}dc(m);const x=m.getType(),b=vA(m);h.set(x,{exportDOM:f&&f.export?f.export.get(m):void 0,klass:m,replace:v,replaceWithKlass:y,sharedNodeState:P3(c[p]),transforms:b})}}const g=new Oi(s,o,h,{disableEvents:i,namespace:a,theme:r},u||console.error,(function(p,m){const v=new Map,y=new Set,x=b=>{Object.keys(b).forEach(w=>{let _=v.get(w);_===void 0&&(_=[],v.set(w,_)),_.push(b[w])})};return p.forEach(b=>{const w=b.klass.importDOM;if(w==null||y.has(w))return;y.add(w);const _=w.call(b.klass);_!==null&&x(_)}),m&&x(m),v})(h,f?f.import:void 0),d,e);return l!==void 0&&(g._pendingEditorState=l,g._dirtyType=2),(function(p){p.registerCommand(Ub,K3,be),p.registerCommand(Gb,U3,be),p.registerCommand(qb,G3,be),p.registerCommand(Yb,q3,be),p.registerCommand(Jb,Y3,be)})(g),g}class Oi{static version;_headless;_parentEditor;_rootElement;_editorState;_pendingEditorState;_compositionKey;_deferred;_keyToDOMMap;_updates;_updating;_listeners;_commands;_nodes;_decorators;_pendingDecorators;_config;_dirtyType;_cloneNotNeeded;_dirtyLeaves;_dirtyElements;_normalizedNodes;_updateTags;_observer;_key;_onError;_htmlConversions;_window;_editable;_blockCursorElement;_createEditorArgs;constructor(t,n,r,o,i,s,a,l){this._createEditorArgs=l,this._parentEditor=n,this._rootElement=null,this._editorState=t,this._pendingEditorState=null,this._compositionKey=null,this._deferred=[],this._keyToDOMMap=new Map,this._updates=[],this._updating=!1,this._listeners={decorator:new Set,editable:new Set,mutation:new Map,root:new Set,textcontent:new Set,update:new Set},this._commands=new Map,this._config=o,this._nodes=r,this._decorators={},this._pendingDecorators=null,this._dirtyType=0,this._cloneNotNeeded=new Set,this._dirtyLeaves=new Set,this._dirtyElements=new Map,this._normalizedNodes=new Set,this._updateTags=new Set,this._observer=null,this._key=I1(),this._onError=i,this._htmlConversions=s,this._editable=a,this._headless=n!==null&&n._headless,this._window=null,this._blockCursorElement=null}isComposing(){return this._compositionKey!=null}registerUpdateListener(t){const n=this._listeners.update;return n.add(t),()=>{n.delete(t)}}registerEditableListener(t){const n=this._listeners.editable;return n.add(t),()=>{n.delete(t)}}registerDecoratorListener(t){const n=this._listeners.decorator;return n.add(t),()=>{n.delete(t)}}registerTextContentListener(t){const n=this._listeners.textcontent;return n.add(t),()=>{n.delete(t)}}registerRootListener(t){const n=this._listeners.root;return t(this._rootElement,null),n.add(t),()=>{t(null,this._rootElement),n.delete(t)}}registerCommand(t,n,r){r===void 0&&Y(35);const o=this._commands;o.has(t)||o.set(t,[new Set,new Set,new Set,new Set,new Set]);const i=o.get(t);i===void 0&&Y(36,String(t));const s=i[r];return s.add(n),()=>{s.delete(n),i.every(a=>a.size===0)&&o.delete(t)}}registerMutationListener(t,n,r){const o=this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(t)).klass,i=this._listeners.mutation;let s=i.get(n);s===void 0&&(s=new Set,i.set(n,s)),s.add(o);const a=r&&r.skipInitialization;return a!==void 0&&a||this.initializeMutationListener(n,o),()=>{s.delete(o),s.size===0&&i.delete(n)}}getRegisteredNode(t){const n=this._nodes.get(t.getType());return n===void 0&&Y(37,t.name),n}resolveRegisteredNodeAfterReplacements(t){for(;t.replaceWithKlass;)t=this.getRegisteredNode(t.replaceWithKlass);return t}initializeMutationListener(t,n){const r=this._editorState,o=Zm(r).get(n.getType());if(!o)return;const i=new Map;for(const s of o.keys())i.set(s,"created");i.size>0&&t(i,{dirtyLeaves:new Set,prevEditorState:r,updateTags:new Set(["registerMutationListener"])})}registerNodeTransformToKlass(t,n){const r=this.getRegisteredNode(t);return r.transforms.add(n),r}registerNodeTransform(t,n){const r=this.registerNodeTransformToKlass(t,n),o=[r],i=r.replaceWithKlass;if(i!=null){const s=this.registerNodeTransformToKlass(i,n);o.push(s)}return(function(s,a){const l=Zm(s.getEditorState()),c=[];for(const u of a){const f=l.get(u);f&&c.push(f)}c.length!==0&&s.update(()=>{for(const u of c)for(const f of u.keys()){const d=Pe(f);d&&d.markDirty()}},s._pendingEditorState===null?{tag:Ei}:void 0)})(this,o.map(s=>s.klass.getType())),()=>{o.forEach(s=>s.transforms.delete(n))}}hasNode(t){return this._nodes.has(t.getType())}hasNodes(t){return t.every(this.hasNode.bind(this))}dispatchCommand(t,n){return te(this,t,n)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(t){const n=this._rootElement;if(t!==n){const r=Ri(this._config.theme,"root"),o=this._pendingEditorState||this._editorState;if(this._rootElement=t,T1(this,n,t,o),n!==null&&(this._config.disableEvents||X3(n),r!=null&&n.classList.remove(...r)),t!==null){const i=jh(t),s=t.style;s.userSelect="text",s.whiteSpace="pre-wrap",s.wordBreak="break-word",t.setAttribute("data-lexical-editor","true"),this._window=i,this._dirtyType=2,Ib(this),this._updateTags.add(Ei),cr(this),this._config.disableEvents||(function(a,l){const c=a.ownerDocument;Bd.set(a,c);const u=El.get(c)??0;u<1&&c.addEventListener("selectionchange",d1),El.set(c,u+1),a.__lexicalEditor=l;const f=u1(a);for(let d=0;d<Vd.length;d++){const[h,g]=Vd[d],p=typeof g=="function"?m=>{_m(m)||(Sm(m),(l.isEditable()||h==="click")&&g(m,l))}:m=>{if(_m(m))return;Sm(m);const v=l.isEditable();switch(h){case"cut":return v&&te(l,nc,m);case"copy":return te(l,tc,m);case"paste":return v&&te(l,yh,m);case"dragstart":return v&&te(l,t1,m);case"dragover":return v&&te(l,n1,m);case"dragend":return v&&te(l,z3,m);case"focus":return v&&te(l,r1,m);case"blur":return v&&te(l,H3,m);case"drop":return v&&te(l,e1,m)}};a.addEventListener(h,p),f.push(()=>{a.removeEventListener(h,p)})}})(t,this),r!=null&&t.classList.add(...r)}else this._window=null,this._updateTags.add(Ei),cr(this);As("root",this,!1,t,n)}}getElementByKey(t){return this._keyToDOMMap.get(t)||null}getEditorState(){return this._editorState}setEditorState(t,n){t.isEmpty()&&Y(38);let r=t;r._readOnly&&(r=S1(t),r._selection=t._selection?t._selection.clone():null),Ob(this);const o=this._pendingEditorState,i=this._updateTags,s=n!==void 0?n.tag:null;o===null||o.isEmpty()||(s!=null&&i.add(s),cr(this)),this._pendingEditorState=r,this._dirtyType=2,this._dirtyElements.set("root",!1),this._compositionKey=null,s!=null&&i.add(s),this._updating||cr(this)}parseEditorState(t,n){return(function(r,o,i){const s=Ah(),a=ht,l=Bt,c=gt,u=o._dirtyElements,f=o._dirtyLeaves,d=o._cloneNotNeeded,h=o._dirtyType;o._dirtyElements=new Map,o._dirtyLeaves=new Set,o._cloneNotNeeded=new Set,o._dirtyType=0,ht=s,Bt=!1,gt=o,Mh(null);try{const g=o._nodes;kh(r.root,g),i&&i(),s._readOnly=!0}catch(g){g instanceof Error&&o._onError(g)}finally{o._dirtyElements=u,o._dirtyLeaves=f,o._cloneNotNeeded=d,o._dirtyType=h,ht=a,Bt=l,gt=c}return s})(typeof t=="string"?JSON.parse(t):t,this,n)}read(t){return cr(this),this.getEditorState().read(t,{editor:this})}update(t,n){(function(r,o,i){r._updating?r._updates.push([o,i]):ac(r,o,i)})(this,t,n)}focus(t,n={}){const r=this._rootElement;r!==null&&(r.setAttribute("autocapitalize","off"),Un(this,()=>{const o=X(),i=qe();o!==null?o.dirty||Ge(o.clone()):i.getChildrenSize()!==0&&(n.defaultSelection==="rootStart"?i.selectStart():i.selectEnd()),SA("focus"),_A(()=>{r.removeAttribute("autocapitalize"),t&&t()})}),this._pendingEditorState===null&&r.removeAttribute("autocapitalize"))}blur(){const t=this._rootElement;t!==null&&t.blur();const n=Ot(this._window);n!==null&&n.removeAllRanges()}isEditable(){return this._editable}setEditable(t){this._editable!==t&&(this._editable=t,As("editable",this,!0,t))}toJSON(){return{editorState:this._editorState.toJSON()}}}Oi.version="0.39.0+prod.esm";let Yd=null;function Mh(e){Yd=e}let xA=1;function R1(e,t){const n=Ph(e,t);return n===void 0&&Y(30,t),n}function Ph(e,t){return e._nodes.get(t)}const bA=typeof queueMicrotask=="function"?queueMicrotask:e=>{Promise.resolve().then(e)};function k1(e){return Te(Ut(e))}function Lh(e){const t=document.activeElement;if(!Be(t))return!1;const n=t.nodeName;return Te(Ut(e))&&(n==="INPUT"||n==="TEXTAREA"||t.contentEditable==="true"&&lc(t)==null)}function aa(e,t,n){const r=e.getRootElement();try{return r!==null&&r.contains(t)&&r.contains(n)&&t!==null&&!Lh(t)&&A1(t)===e}catch{return!1}}function Fh(e){return e instanceof Oi}function A1(e){let t=e;for(;t!=null;){const n=lc(t);if(Fh(n))return n;t=la(t)}return null}function lc(e){return e?e.__lexicalEditor:null}function Eo(e){return rc(e)||e.isToken()}function sr(e){return Eo(e)||e.isSegmented()}function Cr(e){return Cn(e)&&e.nodeType===3}function N1(e){return Cn(e)&&e.nodeType===9}function Ii(e){let t=e;for(;t!=null;){if(Cr(t))return t;t=t.firstChild}return null}function Ml(e,t,n){const r=Hr[t];if(n!==null&&(e&r)===(n&r))return e;let o=e^r;return t==="subscript"?o&=-65:t==="superscript"?o&=-33:t==="lowercase"?(o&=-513,o&=-1025):t==="uppercase"?(o&=-257,o&=-1025):t==="capitalize"&&(o&=-257,o&=-513),o}function M1(e){return J(e)||Kn(e)||Te(e)}function P1(e,t){const n=(function(){const s=Yd;return Yd=null,s})();if((t=t||n&&n.__key)!=null)return void(e.__key=t);ft(),b1();const r=$e(),o=Jr(),i=""+xA++;o._nodeMap.set(i,e),B(e)?r._dirtyElements.set(i,!0):r._dirtyLeaves.add(i),r._cloneNotNeeded.add(i),r._dirtyType=1,e.__key=i}function Ro(e){const t=e.getParent();if(t!==null){const n=e.getWritable(),r=t.getWritable(),o=e.getPreviousSibling(),i=e.getNextSibling(),s=i!==null?i.__key:null,a=o!==null?o.__key:null,l=o!==null?o.getWritable():null,c=i!==null?i.getWritable():null;o===null&&(r.__first=s),i===null&&(r.__last=a),l!==null&&(l.__next=s),c!==null&&(c.__prev=a),n.__prev=null,n.__next=null,n.__parent=null,r.__size--}}function Pl(e){b1(),kl(e)&&Y(323,e.__key,e.__type);const t=e.getLatest(),n=t.__parent,r=Jr(),o=$e(),i=r._nodeMap,s=o._dirtyElements;n!==null&&(function(l,c,u){let f=l;for(;f!==null;){if(u.has(f))return;const d=c.get(f);if(d===void 0)break;u.set(f,!1),f=d.__parent}})(n,i,s);const a=t.__key;o._dirtyType=1,B(e)?s.set(a,!0):o._dirtyLeaves.add(a)}function yt(e){ft();const t=$e(),n=t._compositionKey;if(e!==n){if(t._compositionKey=e,n!==null){const r=Pe(n);r!==null&&r.getWritable()}if(e!==null){const r=Pe(e);r!==null&&r.getWritable()}}}function Mr(){return Yi()?null:$e()._compositionKey}function Pe(e,t){const n=(t||Jr())._nodeMap.get(e);return n===void 0?null:n}function L1(e,t){const n=cc(e,$e());return n!==void 0?Pe(n,t):null}function cc(e,t){return e[`__lexicalKey_${t._key}`]}function Ut(e,t){let n=e;for(;n!=null;){const r=L1(n,t);if(r!==null)return r;n=la(n)}return null}function F1(e){const t=e._decorators,n=Object.assign({},t);return e._pendingDecorators=n,n}function Wm(e){return e.read(()=>qe().getTextContent())}function qe(){return $1(Jr())}function $1(e){return e._nodeMap.get("root")}function Ge(e){ft();const t=Jr();e!==null&&(e.dirty=!0,e.setCachedNodes(null)),t._selection=e}function wi(e){const t=$e(),n=(function(r,o){let i=r;for(;i!=null;){const s=cc(i,o);if(s!==void 0)return s;i=la(i)}return null})(e,t);return n===null?e===t.getRootElement()?Pe("root"):null:Pe(n)}function O1(e){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(e)}function $h(e){const t=[];let n=e;for(;n!==null;)t.push(n),n=n._parentEditor;return t}function I1(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substring(0,5)}function D1(e){return Cr(e)?e.nodeValue:null}function Oh(e,t,n){const r=Ot(hn(t));if(r===null)return;const o=r.anchorNode;let{anchorOffset:i,focusOffset:s}=r;if(o!==null){let a=D1(o);const l=Ut(o);if(a!==null&&J(l)){if(a===Zl&&n){const c=n.length;a=n,i=c,s=c}a!==null&&Ih(l,a,i,s,e)}}}function Ih(e,t,n,r,o){let i=e;if(i.isAttached()&&(o||!i.isDirty())){const s=i.isComposing();let a=t;(s||o)&&t[t.length-1]===Zl&&(a=t.slice(0,-1));const l=i.getTextContent();if(o||a!==l){if(a===""){if(yt(null),ra||Ki||oa)i.remove();else{const p=$e();setTimeout(()=>{p.update(()=>{i.isAttached()&&i.remove()})},20)}return}const c=i.getParent(),u=Zn(),f=i.getTextContentSize(),d=Mr(),h=i.getKey();if(i.isToken()||d!==null&&h===d&&!s||W(u)&&(c!==null&&!c.canInsertTextBefore()&&u.anchor.offset===0||u.anchor.key===e.__key&&u.anchor.offset===0&&!i.canInsertTextBefore()&&!s||u.focus.key===e.__key&&u.focus.offset===f&&!i.canInsertTextAfter()&&!s))return void i.markDirty();const g=X();if(!W(g)||n===null||r===null)return void Km(i,a,g);if(g.setTextNodeRange(i,n,i,r),i.isSegmented()){const p=Fe(i.getTextContent());i.replace(p),i=p}Km(i,a,g)}}}function Km(e,t,n){if(e.setTextContent(t),W(n)){const r=e.getKey();for(const o of["anchor","focus"]){const i=n[o];i.type==="text"&&i.key===r&&(i.offset=qn(e,i.offset,"clamp"))}}}function Pa(e,t,n){const r=t[n]||!1;return r==="any"||r===e[n]}function wA(e,t){return Pa(e,t,"altKey")&&Pa(e,t,"ctrlKey")&&Pa(e,t,"shiftKey")&&Pa(e,t,"metaKey")}function Me(e,t,n){return wA(e,n)&&e.key.toLowerCase()===t.toLowerCase()}const rr={ctrlKey:!wn,metaKey:wn},Um={altKey:wn,ctrlKey:!wn};function Gm(e){return e.key==="Backspace"}function qm(e){return Me(e,"a",rr)}function CA(e){const t=qe();if(W(e)){const n=e.anchor,r=e.focus,o=n.getNode().getTopLevelElementOrThrow().getParentOrThrow();return n.set(o.getKey(),0,"element"),r.set(o.getKey(),o.getChildrenSize(),"element"),Bs(e),e}{const n=t.select(0,t.getChildrenSize());return Ge(Bs(n)),n}}function Ri(e,t){e.__lexicalClassNameCache===void 0&&(e.__lexicalClassNameCache={});const n=e.__lexicalClassNameCache,r=n[t];if(r!==void 0)return r;const o=e[t];if(typeof o=="string"){const i=Pb(o);return n[t]=i,i}return o}function Dh(e,t,n,r,o){if(n.size===0)return;const i=r.__type,s=r.__key,a=t.get(i);a===void 0&&Y(33,i);const l=a.klass;let c=e.get(l);c===void 0&&(c=new Map,e.set(l,c));const u=c.get(s),f=u==="destroyed"&&o==="created";(u===void 0||f)&&c.set(s,f?"updated":o)}function Ym(e,t,n){const r=e.getParent();let o=n,i=e;return r!==null&&(t&&n===0?(o=i.getIndexWithinParent(),i=r):t||n!==i.getChildrenSize()||(o=i.getIndexWithinParent()+1,i=r)),i.getChildAtIndex(t?o-1:o)}function Xd(e,t){const n=e.offset;if(e.type==="element")return Ym(e.getNode(),t,n);{const r=e.getNode();if(t&&n===0||!t&&n===r.getTextContentSize()){const o=t?r.getPreviousSibling():r.getNextSibling();return o===null?Ym(r.getParentOrThrow(),t,r.getIndexWithinParent()+(t?0:1)):o}}return null}function j1(e){const t=hn(e).event,n=t&&t.inputType;return n==="insertFromPaste"||n==="insertFromPasteAsQuotation"}function te(e,t,n){return(function(r,o,i){const s=$h(r);for(let a=4;a>=0;a--)for(let l=0;l<s.length;l++){const c=s[l],u=c._commands.get(o);if(u!==void 0){const f=u[a];if(f!==void 0){const d=Array.from(f),h=d.length;let g=!1;if(Un(c,()=>{for(let p=0;p<h;p++)if(d[p](i,r))return void(g=!0)}),g)return g}}}return!1})(e,t,n)}function uc(e){return!at(e)&&!e.isLastChild()&&!e.isInline()}function Lo(e,t){const n=e._keyToDOMMap.get(t);return n===void 0&&Y(75,t),n}function la(e){const t=e.assignedSlot||e.parentElement;return Qd(t)?t.host:t}function V1(e){return N1(e)?e:Be(e)?e.ownerDocument:null}function SA(e){ft(),$e()._updateTags.add(e)}function _A(e){ft(),$e()._deferred.push(e)}function Zd(e,t){let n=e.getParent();for(;n!==null;){if(n.is(t))return!0;n=n.getParent()}return!1}function jh(e){const t=V1(e);return t?t.defaultView:null}function hn(e){const t=e._window;return t===null&&Y(78),t}function TA(e){return B(e)&&e.isInline()||Te(e)&&e.isInline()}function EA(e){let t=e.getParentOrThrow();for(;t!==null;){if(vt(t))return t;t=t.getParentOrThrow()}return t}function vt(e){return at(e)||B(e)&&e.isShadowRoot()}function RA(e){const t=e.constructor.clone(e);return P1(t,null),t.afterCloneFrom(e),t}function Et(e){const t=$e(),n=e.getType(),r=Ph(t,n);r===void 0&&Y(200,e.constructor.name,n);const{replace:o,replaceWithKlass:i}=r;if(o!==null){const s=o(e),a=s.constructor;return i!==null?s instanceof i||Y(201,i.name,i.getType(),a.name,a.getType(),e.constructor.name,n):s instanceof e.constructor&&a!==e.constructor||Y(202,a.name,a.getType(),e.constructor.name,n),s.__key===e.__key&&Y(203,e.constructor.name,n,a.name,a.getType()),s}return e}function au(e,t){!at(e.getParent())||B(t)||Te(t)||Y(99)}function kA(e){const t=Pe(e);return t===null&&Y(63,e),t}function lu(e){return(Te(e)||B(e)&&!e.canBeEmpty())&&!e.isInline()}function Jd(e,t,n){n.style.removeProperty("caret-color"),t._blockCursorElement=null;const r=e.parentElement;r!==null&&r.removeChild(e)}function Ot(e){return Ln?(e||window).getSelection():null}function AA(e){const t=jh(e);return t?t.getSelection():null}function B1(e){return Be(e)&&e.tagName==="A"}function Be(e){return Cn(e)&&e.nodeType===1}function Cn(e){return typeof e=="object"&&e!==null&&"nodeType"in e&&typeof e.nodeType=="number"}function Qd(e){return Cn(e)&&e.nodeType===11}function ef(e){const t=new RegExp(/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|mark|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var|#text)$/,"i");return e.nodeName.match(t)!==null}function Ll(e){const t=new RegExp(/^(address|article|aside|blockquote|canvas|dd|div|dl|dt|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hr|li|main|nav|noscript|ol|p|pre|section|table|td|tfoot|ul|video)$/,"i");return e.nodeName.match(t)!==null}function Nr(e){if(Te(e)&&!e.isInline())return!0;if(!B(e)||vt(e))return!1;const t=e.getFirstChild(),n=t===null||Kn(t)||J(t)||t.isInline();return!e.isInline()&&e.canBeEmpty()!==!1&&n}function Zi(){return $e()}const Xm=new WeakMap,NA=new Map;function Zm(e){if(!e._readOnly&&e.isEmpty())return NA;e._readOnly||Y(192);let t=Xm.get(e);return t||(t=(function(n){const r=new Map;for(const[o,i]of n._nodeMap){const s=i.__type;let a=r.get(s);a||(a=new Map,r.set(s,a)),a.set(o,i)}return r})(e),Xm.set(e,t)),t}function z1(e){const t=e.constructor.clone(e);return t.afterCloneFrom(e),t}function MA(e){return(t=z1(e))[f1]=!0,t;var t}function Vh(e,t){const n=parseInt(e.style.paddingInlineStart,10)||0,r=Math.round(n/40);t.setIndent(r)}function PA(e){e.__lexicalUnmanaged=!0}function LA(e){return e.__lexicalUnmanaged===!0}function cs(e,t){return(function(n,r){return Object.prototype.hasOwnProperty.call(n,r)})(e,t)&&e[t]!==Wn[t]}function dc(e){const t=um in e.prototype?e.prototype[um]():void 0,n=(function(s){if(!(s===Wn||s.prototype instanceof Wn)){let a="<unknown>",l="<unknown>";try{a=s.getType()}catch{}try{Oi.version&&(l=JSON.parse(Oi.version))}catch{}Y(290,s.name,a,l)}return s===ia||s===Tt||s===Wn})(e),r=!n&&cs(e,"getType")?e.getType():void 0;let o,i=r;if(t)if(r)o=t[r];else for(const[s,a]of Object.entries(t))i=s,o=a;if(!n&&i&&(cs(e,"getType")||(e.getType=()=>i),cs(e,"clone")||(e.clone=s=>(Mh(s),new e)),cs(e,"importJSON")||(e.importJSON=o&&o.$importJSON||(s=>new e().updateFromJSON(s))),!cs(e,"importDOM")&&o)){const{importDOM:s}=o;s&&(e.importDOM=()=>s)}return{ownNodeConfig:o,ownNodeType:i}}function H1(e){const t=Zi();return ft(),new(t.resolveRegisteredNodeAfterReplacements(t.getRegisteredNode(e))).klass}const we=(e,t)=>{let n=e;for(;n!=null&&!at(n);){if(t(n))return n;n=n.getParent()}return null},FA={next:"previous",previous:"next"};class Bh{origin;constructor(t){this.origin=t}[Symbol.iterator](){return Wh({hasNext:Wr,initial:this.getAdjacentCaret(),map:t=>t,step:t=>t.getAdjacentCaret()})}getAdjacentCaret(){return nt(this.getNodeAtCaret(),this.direction)}getSiblingCaret(){return nt(this.origin,this.direction)}remove(){const t=this.getNodeAtCaret();return t&&t.remove(),this}replaceOrInsert(t,n){const r=this.getNodeAtCaret();return t.is(this.origin)||t.is(r)||(r===null?this.insert(t):r.replace(t,n)),this}splice(t,n,r="next"){const o=r===this.direction?n:Array.from(n).reverse();let i=this;const s=this.getParentAtCaret(),a=new Map;for(let l=i.getAdjacentCaret();l!==null&&a.size<t;l=l.getAdjacentCaret()){const c=l.origin.getWritable();a.set(c.getKey(),c)}for(const l of o){if(a.size>0){const c=i.getNodeAtCaret();if(c){if(a.delete(c.getKey()),a.delete(l.getKey()),!(c.is(l)||i.origin.is(l))){const u=l.getParent();u&&u.is(s)&&l.remove(),c.replace(l)}}else c===null&&Y(263,Array.from(a).join(" "))}else i.insert(l);i=nt(l,this.direction)}for(const l of a.values())l.remove();return this}}class Ks extends Bh{type="child";getLatest(){const t=this.origin.getLatest();return t===this.origin?this:Ft(t,this.direction)}getParentCaret(t="root"){return nt(zh(this.getParentAtCaret(),t),this.direction)}getFlipped(){const t=Ko(this.direction);return nt(this.getNodeAtCaret(),t)||Ft(this.origin,t)}getParentAtCaret(){return this.origin}getChildCaret(){return this}isSameNodeCaret(t){return t instanceof Ks&&this.direction===t.direction&&this.origin.is(t.origin)}isSamePointCaret(t){return this.isSameNodeCaret(t)}}const $A={root:at,shadowRoot:vt};function Ko(e){return FA[e]}function zh(e,t="root"){return $A[t](e)?null:e}class Fo extends Bh{type="sibling";getLatest(){const t=this.origin.getLatest();return t===this.origin?this:nt(t,this.direction)}getSiblingCaret(){return this}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return B(this.origin)?Ft(this.origin,this.direction):null}getParentCaret(t="root"){return nt(zh(this.getParentAtCaret(),t),this.direction)}getFlipped(){const t=Ko(this.direction);return nt(this.getNodeAtCaret(),t)||Ft(this.origin.getParentOrThrow(),t)}isSamePointCaret(t){return t instanceof Fo&&this.direction===t.direction&&this.origin.is(t.origin)}isSameNodeCaret(t){return(t instanceof Fo||t instanceof $o)&&this.direction===t.direction&&this.origin.is(t.origin)}}class $o extends Bh{type="text";offset;constructor(t,n){super(t),this.offset=n}getLatest(){const t=this.origin.getLatest();return t===this.origin?this:Oo(t,this.direction,this.offset)}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return null}getParentCaret(t="root"){return nt(zh(this.getParentAtCaret(),t),this.direction)}getFlipped(){return Oo(this.origin,Ko(this.direction),this.offset)}isSamePointCaret(t){return t instanceof $o&&this.direction===t.direction&&this.origin.is(t.origin)&&this.offset===t.offset}isSameNodeCaret(t){return(t instanceof Fo||t instanceof $o)&&this.direction===t.direction&&this.origin.is(t.origin)}getSiblingCaret(){return nt(this.origin,this.direction)}}function Gn(e){return e instanceof $o}function Wr(e){return e instanceof Fo}function zt(e){return e instanceof Ks}const OA={next:class extends $o{direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends $o{direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},IA={next:class extends Fo{direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends Fo{direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},DA={next:class extends Ks{direction="next";getNodeAtCaret(){return this.origin.getFirstChild()}insert(e){return this.origin.splice(0,0,[e]),this}},previous:class extends Ks{direction="previous";getNodeAtCaret(){return this.origin.getLastChild()}insert(e){return this.origin.splice(this.origin.getChildrenSize(),0,[e]),this}}};function nt(e,t){return e?new IA[t](e):null}function Oo(e,t,n){return e?new OA[t](e,qn(e,n)):null}function qn(e,t,n="error"){const r=e.getTextContentSize();let o=t==="next"?r:t==="previous"?0:t;return(o<0||o>r)&&(n!=="clamp"&&Nb(284,String(t),String(r),e.getKey()),o=o<0?0:r),o}function Jm(e,t){return new VA(e,t)}function Ft(e,t){return B(e)?new DA[t](e):null}function jA(e){return e&&e.getChildCaret()||e}function ca(e){return e&&jA(e.getAdjacentCaret())}class Hh{type="node-caret-range";direction;anchor;focus;constructor(t,n,r){this.anchor=t,this.focus=n,this.direction=r}getLatest(){const t=this.anchor.getLatest(),n=this.focus.getLatest();return t===this.anchor&&n===this.focus?this:new Hh(t,n,this.direction)}isCollapsed(){return this.anchor.isSamePointCaret(this.focus)}getTextSlices(){const t=o=>{const i=this[o].getLatest();return Gn(i)?(function(s,a){const{direction:l,origin:c}=s,u=qn(c,a==="focus"?Ko(l):l);return Jm(s,u-s.offset)})(i,o):null},n=t("anchor"),r=t("focus");if(n&&r){const{caret:o}=n,{caret:i}=r;if(o.isSameNodeCaret(i))return[Jm(o,i.offset-o.offset),null]}return[n,r]}iterNodeCarets(t="root"){const n=Gn(this.anchor)?this.anchor.getSiblingCaret():this.anchor.getLatest(),r=this.focus.getLatest(),o=Gn(r),i=s=>s.isSameNodeCaret(r)?null:ca(s)||s.getParentCaret(t);return Wh({hasNext:s=>s!==null&&!(o&&r.isSameNodeCaret(s)),initial:n.isSameNodeCaret(r)?null:i(n),map:s=>s,step:i})}[Symbol.iterator](){return this.iterNodeCarets("root")}}class VA{type="slice";caret;distance;constructor(t,n){this.caret=t,this.distance=n}getSliceIndices(){const{distance:t,caret:{offset:n}}=this,r=n+t;return r<n?[r,n]:[n,r]}getTextContent(){const[t,n]=this.getSliceIndices();return this.caret.origin.getTextContent().slice(t,n)}getTextContentSize(){return Math.abs(this.distance)}removeTextSlice(){const{caret:{origin:t,direction:n}}=this,[r,o]=this.getSliceIndices(),i=t.getTextContent();return Oo(t.setTextContent(i.slice(0,r)+i.slice(o)),n,r)}}function Us(e){return Kr(e,nt(qe(),e.direction))}function W1(e){return Kr(e,e)}function Kr(e,t){return e.direction!==t.direction&&Y(265),new Hh(e,t,e.direction)}function Wh(e){const{initial:t,hasNext:n,step:r,map:o}=e;let i=t;return{[Symbol.iterator](){return this},next(){if(!n(i))return{done:!0,value:void 0};const s={done:!1,value:o(i)};return i=r(i),s}}}function K1(e,t){const n=il(e.origin,t.origin);switch(n===null&&Y(275,e.origin.getKey(),t.origin.getKey()),n.type){case"same":{const r=e.type==="text",o=t.type==="text";return r&&o?(function(i,s){return Math.sign(i-s)})(e.offset,t.offset):e.type===t.type?0:r?-1:o?1:e.type==="child"?-1:1}case"ancestor":return e.type==="child"?-1:1;case"descendant":return t.type==="child"?1:-1;case"branch":return U1(n)}}function U1(e){const{a:t,b:n}=e,r=t.__key,o=n.__key;let i=t,s=n;for(;i&&s;i=i.getNextSibling(),s=s.getNextSibling()){if(i.__key===o)return-1;if(s.__key===r)return 1}return i===null?1:-1}function La(e,t){return t.is(e)}function Qm(e){return B(e)?[e.getLatest(),null]:[e.getParent(),e.getLatest()]}function il(e,t){if(e.is(t))return{commonAncestor:e,type:"same"};const n=new Map;for(let[r,o]=Qm(e);r;o=r,r=r.getParent())n.set(r,o);for(let[r,o]=Qm(t);r;o=r,r=r.getParent()){const i=n.get(r);if(i!==void 0)return i===null?(La(e,r)||Y(276),{commonAncestor:r,type:"ancestor"}):o===null?(La(t,r)||Y(277),{commonAncestor:r,type:"descendant"}):((B(i)||La(e,i))&&(B(o)||La(t,o))&&r.is(i.getParent())&&r.is(o.getParent())||Y(278),{a:i,b:o,commonAncestor:r,type:"branch"})}return null}function An(e,t){const{type:n,key:r,offset:o}=e,i=kA(e.key);return n==="text"?(J(i)||Y(266,i.getType(),r),Oo(i,t,o)):(B(i)||Y(267,i.getType(),r),zA(i,e.offset,t))}function Sn(e,t){const{origin:n,direction:r}=t,o=r==="next";Gn(t)?e.set(n.getKey(),t.offset,"text"):Wr(t)?J(n)?e.set(n.getKey(),qn(n,r),"text"):e.set(n.getParentOrThrow().getKey(),n.getIndexWithinParent()+(o?1:0),"element"):(zt(t)&&B(n)||Y(268),e.set(n.getKey(),o?0:n.getChildrenSize(),"element"))}function G1(e){const t=X(),n=W(t)?t:ic();return sl(n,e),Ge(n),n}function sl(e,t){Sn(e.anchor,t.anchor),Sn(e.focus,t.focus)}function ey(e){const{anchor:t,focus:n}=e,r=An(t,"next"),o=An(n,"next"),i=K1(r,o)<=0?"next":"previous";return Kr(br(r,i),br(o,i))}function ua(e){const{direction:t,origin:n}=e,r=nt(n,Ko(t)).getNodeAtCaret();return r?nt(r,t):Ft(n.getParentOrThrow(),t)}function ty(e,t="root"){const n=[e];for(let r=zt(e)?e.getParentCaret(t):e.getSiblingCaret();r!==null;r=r.getParentCaret(t))n.push(ua(r));return n}function cu(e){return!!e&&e.origin.isAttached()}function BA(e,t="removeEmptySlices"){if(e.isCollapsed())return e;const n="root",r="next";let o=t;const i=q1(e,r),s=ty(i.anchor,n),a=ty(i.focus.getFlipped(),n),l=new Set,c=[];for(const g of i.iterNodeCarets(n))if(zt(g))l.add(g.origin.getKey());else if(Wr(g)){const{origin:p}=g;B(p)&&!l.has(p.getKey())||c.push(p)}for(const g of c)g.remove();for(const g of i.getTextSlices()){if(!g)continue;const{origin:p}=g.caret,m=p.getTextContentSize(),v=ua(nt(p,r)),y=p.getMode();if(Math.abs(g.distance)===m&&o==="removeEmptySlices"||y==="token"&&g.distance!==0)v.remove();else if(g.distance!==0){o="removeEmptySlices";let x=g.removeTextSlice();const b=g.caret.origin;if(y==="segmented"){const w=x.origin,_=Fe(w.getTextContent()).setStyle(w.getStyle()).setFormat(w.getFormat());v.replaceOrInsert(_),x=Oo(_,r,x.offset)}b.is(s[0].origin)&&(s[0]=x),b.is(a[0].origin)&&(a[0]=x.getFlipped())}}let u,f;for(const g of s)if(cu(g)){u=Lt(g);break}for(const g of a)if(cu(g)){f=Lt(g);break}const d=(function(g,p,m){if(!g||!p)return null;const v=g.getParentAtCaret(),y=p.getParentAtCaret();if(!v||!y)return null;const x=v.getParents().reverse();x.push(v);const b=y.getParents().reverse();b.push(y);const w=Math.min(x.length,b.length);let _;for(_=0;_<w&&x[_]===b[_];_++);const E=(M,F)=>{let D;for(let j=_;j<M.length;j++){const I=M[j];if(vt(I))return;!D&&F(I)&&(D=I)}return D},R=E(x,Nr),k=R&&E(b,M=>m.has(M.getKey())&&Nr(M));return R&&k?[R,k]:null})(u,f,l);if(d){const[g,p]=d;Ft(g,"previous").splice(0,p.getChildren()),p.remove()}const h=[u,f,...s,...a].find(cu);if(h)return W1(br(Lt(h),e.direction));Y(269,JSON.stringify(s.map(g=>g.origin.__key)))}function Lt(e){const t=(function(o){let i=o;for(;zt(i);){const s=ca(i);if(!zt(s))break;i=s}return i})(e.getLatest()),{direction:n}=t;if(J(t.origin))return Gn(t)?t:Oo(t.origin,n,n);const r=t.getAdjacentCaret();return Wr(r)&&J(r.origin)?Oo(r.origin,n,Ko(n)):t}function Kh(e){return Gn(e)&&e.offset!==qn(e.origin,e.direction)}function br(e,t){return e.direction===t?e:e.getFlipped()}function q1(e,t){return e.direction===t?e:Kr(br(e.focus,t),br(e.anchor,t))}function zA(e,t,n){let r=Ft(e,"next");for(let o=0;o<t;o++){const i=r.getAdjacentCaret();if(i===null)break;r=i}return br(r,n)}function HA(e){const{origin:t,offset:n,direction:r}=e;if(n===qn(t,r))return e.getSiblingCaret();if(n===qn(t,Ko(r)))return ua(e.getSiblingCaret());const[o]=t.splitText(n);return J(o)||Y(281),br(nt(o,"next"),r)}function WA(e,t){return!0}function KA(e,{$copyElementNode:t=RA,$splitTextPointCaretNext:n=HA,rootMode:r="shadowRoot",$shouldSplit:o=WA}={}){if(Gn(e))return n(e);const i=e.getParentCaret(r);if(i){const{origin:s}=i;if(zt(e)&&(!s.canBeEmpty()||!o(s,"first")))return ua(i);const a=(function(l){const c=[];for(let u=l.getAdjacentCaret();u;u=u.getAdjacentCaret())c.push(u.origin);return c})(e);(a.length>0||s.canBeEmpty()&&o(s,"last"))&&i.insert(t(s).splice(0,0,a))}return i}function UA(e,t){if(!t||e===t)return e;for(const n in t)if(e[n]!==t[n])return{...e,...t};return e}const tf=new Map;function Y1(e){const t={};if(!e)return t;const n=e.split(";");for(const r of n)if(r!==""){const[o,i]=r.split(/:([^]+)/);o&&i&&(t[o.trim()]=i.trim())}return t}function ny(e){let t=tf.get(e);return t===void 0&&(t=Y1(e),tf.set(e,t)),t}function X1(e){const t=Zi().getElementByKey(e.getKey());if(t===null)return null;const n=t.ownerDocument.defaultView;return n===null?null:n.getComputedStyle(t)}function Z1(e){return X1(at(e)?e:e.getParentOrThrow())}function ry(e){const t=Z1(e);return t!==null&&t.direction==="rtl"}function J1(e,t,n="self"){const r=e.getStartEndPoints();if(t.isSelected(e)&&!sr(t)&&r!==null){const[o,i]=r,s=e.isBackward(),a=o.getNode(),l=i.getNode(),c=t.is(a),u=t.is(l);if(c||u){const[f,d]=Gd(e),h=a.is(l),g=t.is(s?l:a),p=t.is(s?a:l);let m,v=0;h?(v=f>d?d:f,m=f>d?f:d):g?(v=s?d:f,m=void 0):p&&(v=0,m=s?f:d);const y=t.__text.slice(v,m);y!==t.__text&&(n==="clone"&&(t=MA(t)),t.__text=y)}}return t}function GA(e){const t=e.getStyle(),n=Y1(t);tf.set(t,n)}function Q1(e){const t=ew(e);return t!==null&&t.writingMode==="vertical-rl"}function ew(e){const t=e.anchor.getNode();return B(t)?X1(t):Z1(t)}function oy(e,t){let n=Q1(e)?!t:t;tw(e)&&(n=!n);const r=An(e.focus,n?"previous":"next");if(Kh(r))return!1;for(const o of Us(r)){if(zt(o))return!o.origin.isInline();if(!B(o.origin)){if(Te(o.origin))return!0;break}}return!1}function qA(e,t,n,r){e.modify(t?"extend":"move",n,r)}function tw(e){const t=ew(e);return t!==null&&t.direction==="rtl"}function iy(e,t,n){const r=tw(e);let o;o=Q1(e)||r?!n:n,qA(e,t,o,"character")}function nw(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const o of t)r.append("v",o);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const rw=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,YA=rw&&"documentMode"in document?document.documentMode:null;!(!rw||!("InputEvent"in window)||YA)&&"getTargetRanges"in new window.InputEvent("input");function ow(...e){const t=[];for(const n of e)if(n&&typeof n=="string")for(const[r]of n.matchAll(/\S+/g))t.push(r);return t}function Nn(...e){return()=>{for(let t=e.length-1;t>=0;t--)e[t]();e.length=0}}function et(e,...t){const n=ow(...t);n.length>0&&e.classList.add(...n)}function Yn(e,...t){const n=ow(...t);n.length>0&&e.classList.remove(...n)}function XA(e){return e?e.getAdjacentCaret():null}function ZA(e,t){let n=e;for(;n!=null;){if(n instanceof t)return n;n=n.getParent()}return null}function JA(e){const t=we(e,n=>B(n)&&!n.isInline());return B(t)||nw(4,e.__key),t}function QA(e){const t=X()||Zn();let n;if(W(t))n=An(t.focus,"next");else{if(t!=null){const s=t.getNodes(),a=s[s.length-1];a&&(n=nt(a,"next"))}n=n||Ft(qe(),"previous").getFlipped().insert(ve())}const r=eN(e,n),o=ca(r),i=zt(o)?Lt(o):r;return G1(W1(i)),e.getLatest()}function eN(e,t,n){let r=br(t,"next");for(let o=r;o;o=KA(o,n))r=o;return Gn(r)&&nw(283),r.insert(e.isInline()?ve().append(e):e),br(nt(e.getLatest(),"next"),t.direction)}function Pr(e,t){return e!==null&&Object.getPrototypeOf(e).constructor.name===t.name}function tN(e,t){Ft(e,"next").insert(t)}function iw(e,t){return sw(e,t,null)}function sw(e,t,n){let r=!1;for(const o of lw(e))t(o)?n!==null&&n(o):(r=!0,B(o)&&sw(o,t,n||(i=>o.insertAfter(i))),o.remove());return r}function aw(e,t){const n=[],r=Array.from(e).reverse();for(let o=r.pop();o!==void 0;o=r.pop())if(t(o))n.push(o);else if(B(o))for(const i of lw(o))r.push(i);return n}function lw(e){return nN(Ft(e,"previous"))}function nN(e){return Wh({hasNext:Wr,initial:e.getAdjacentCaret(),map:t=>t.origin.getLatest(),step:t=>t.getAdjacentCaret()})}function cw(){const[e]=lt(),[t,n]=S.useState(!1),[r,o]=S.useState(!1),[i,s]=S.useState(!1),[a,l]=S.useState(!1),[c,u]=S.useState("left"),f=c==="left",d=c==="center",h=c==="right",g=S.useCallback(()=>{const v=X();W(v)&&(n(v.hasFormat("bold")),o(v.hasFormat("italic")),s(v.hasFormat("underline")),l(v.hasFormat("strikethrough")))},[]),p=S.useCallback(v=>{u(v)},[]),m=S.useCallback(()=>{const v=X();if(!W(v))return;const y=v.anchor.getNode(),x=y.getKey()==="root"?y:y.getTopLevelElementOrThrow();if(B(x)){const b=x.getFormatType();p(b)}},[p]);return S.useEffect(()=>{const v=Nn(e.registerCommand(Vt,(y,x)=>(e.read(()=>{g()}),!1),ur),e.registerCommand(_i,(y,x)=>(e.read(()=>{p(y)}),!1),ur),e.registerCommand(fr,(y,x)=>(e.read(()=>{g(),m()}),!1),ur));return()=>{v()}},[e,g,p,m]),{isBold:t,isItalic:r,isUnderline:i,isStrikethrough:a,alignment:c,isAlignLeft:f,isAlignCenter:d,isAlignRight:h}}var ae=(e=>(e.BOLD="font-bold",e.ITALIC="font-italic",e.UNDERLINE="font-underline",e.STRIKETHROUGH="font-strikethrough",e.ALIGN_LEFT="align-left",e.ALIGN_CENTER="align-center",e.ALIGN_RIGHT="align-right",e.LINK="insert-link",e.IMAGE="insert-image",e.TABLE="insert-table",e.BULLET_LIST="insert-bullet-list",e.NUMBERED_LIST="insert-numbered-list",e))(ae||{});function rN(){const{isBold:e,isItalic:t,isUnderline:n,isStrikethrough:r,isAlignLeft:o,isAlignCenter:i,isAlignRight:s}=cw(),l=na().toolbar.actions,{availableActions:c}=e3(),u=S.useMemo(()=>({id:ae.BOLD,IconComponent:Kk,label:l.bold,isActive:e}),[l.bold,e]),f=S.useMemo(()=>({id:ae.ITALIC,IconComponent:Gk,label:l.italic,isActive:t}),[l.italic,t]),d=S.useMemo(()=>({id:ae.UNDERLINE,IconComponent:Qk,label:l.underline,isActive:n}),[l.underline,n]),h=S.useMemo(()=>({id:ae.STRIKETHROUGH,IconComponent:Zk,label:l.strikethrough,isActive:r}),[l.strikethrough,r]),g=S.useMemo(()=>({id:ae.ALIGN_LEFT,IconComponent:Hk,label:l.alignLeft,isActive:o}),[l.alignLeft,o]),p=S.useMemo(()=>({id:ae.ALIGN_CENTER,IconComponent:zk,label:l.alignCenter,isActive:i}),[l.alignCenter,i]),m=S.useMemo(()=>({id:ae.ALIGN_RIGHT,IconComponent:Wk,label:l.alignRight,isActive:s}),[l.alignRight,s]),v=S.useMemo(()=>({id:ae.BULLET_LIST,IconComponent:Yk,label:l.bulletList}),[l.bulletList]),y=S.useMemo(()=>({id:ae.NUMBERED_LIST,IconComponent:Xk,label:l.numberedList}),[l.numberedList]),x=S.useMemo(()=>({id:ae.LINK,IconComponent:qk,label:l.link}),[l.link]),b=S.useMemo(()=>({id:ae.IMAGE,IconComponent:Uk,label:l.image}),[l.image]),w=S.useMemo(()=>({id:ae.TABLE,IconComponent:Jk,label:l.table}),[l.table]),_=S.useMemo(()=>({[ae.BOLD]:u,[ae.ITALIC]:f,[ae.UNDERLINE]:d,[ae.STRIKETHROUGH]:h,[ae.ALIGN_LEFT]:g,[ae.ALIGN_CENTER]:p,[ae.ALIGN_RIGHT]:m,[ae.BULLET_LIST]:v,[ae.NUMBERED_LIST]:y,[ae.LINK]:x,[ae.IMAGE]:b,[ae.TABLE]:w}),[u,f,d,h,g,p,m,v,y,x,b,w]),E=S.useMemo(()=>c.map(k=>k.map(M=>_[M])),[c,_]);return{availableActions:S.useMemo(()=>E.flat(),[E]),availableActionGroups:E}}const oN=Symbol.for("preact-signals");function Uh(){if(ki>1)return void ki--;let e,t=!1;for(;Ms!==void 0;){let n=Ms;for(Ms=void 0,nf++;n!==void 0;){const r=n.o;if(n.o=void 0,n.f&=-3,!(8&n.f)&&dw(n))try{n.c()}catch(o){t||(e=o,t=!0)}n=r}}if(nf=0,ki--,t)throw e}let Ne,Ms;function sy(e){const t=Ne;Ne=void 0;try{return e()}finally{Ne=t}}let ki=0,nf=0,al=0;function ay(e){if(Ne===void 0)return;let t=e.n;return t===void 0||t.t!==Ne?(t={i:0,S:e,p:Ne.s,n:void 0,t:Ne,e:void 0,x:void 0,r:t},Ne.s!==void 0&&(Ne.s.n=t),Ne.s=t,e.n=t,32&Ne.f&&e.S(t),t):t.i===-1?(t.i=0,t.n!==void 0&&(t.n.p=t.p,t.p!==void 0&&(t.p.n=t.n),t.p=Ne.s,t.n=void 0,Ne.s.n=t,Ne.s=t),t):void 0}function Nt(e,t){this.v=e,this.i=0,this.n=void 0,this.t=void 0,this.W=t?.watched,this.Z=t?.unwatched,this.name=t?.name}function uw(e,t){return new Nt(e,t)}function dw(e){for(let t=e.s;t!==void 0;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function ly(e){for(let t=e.s;t!==void 0;t=t.n){const n=t.S.n;if(n!==void 0&&(t.r=n),t.S.n=t,t.i=-1,t.n===void 0){e.s=t;break}}}function fw(e){let t,n=e.s;for(;n!==void 0;){const r=n.p;n.i===-1?(n.S.U(n),r!==void 0&&(r.n=n.n),n.n!==void 0&&(n.n.p=r)):t=n,n.S.n=n.r,n.r!==void 0&&(n.r=void 0),n=r}e.s=t}function Jo(e,t){Nt.call(this,void 0),this.x=e,this.s=void 0,this.g=al-1,this.f=4,this.W=t?.watched,this.Z=t?.unwatched,this.name=t?.name}function hw(e){const t=e.u;if(e.u=void 0,typeof t=="function"){ki++;const n=Ne;Ne=void 0;try{t()}catch(r){throw e.f&=-2,e.f|=8,Gh(e),r}finally{Ne=n,Uh()}}}function Gh(e){for(let t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,hw(e)}function iN(e){if(Ne!==this)throw new Error("Out-of-order effect");fw(this),Ne=e,this.f&=-2,8&this.f&&Gh(this),Uh()}function di(e,t){this.x=e,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32,this.name=t?.name}function sN(e,t){const n=new di(e,t);try{n.c()}catch(o){throw n.d(),o}const r=n.d.bind(n);return r[Symbol.dispose]=r,r}Nt.prototype.brand=oN,Nt.prototype.h=function(){return!0},Nt.prototype.S=function(e){const t=this.t;t!==e&&e.e===void 0&&(e.x=t,this.t=e,t!==void 0?t.e=e:sy(()=>{var n;(n=this.W)==null||n.call(this)}))},Nt.prototype.U=function(e){if(this.t!==void 0){const t=e.e,n=e.x;t!==void 0&&(t.x=n,e.e=void 0),n!==void 0&&(n.e=t,e.x=void 0),e===this.t&&(this.t=n,n===void 0&&sy(()=>{var r;(r=this.Z)==null||r.call(this)}))}},Nt.prototype.subscribe=function(e){return sN(()=>{const t=this.value,n=Ne;Ne=void 0;try{e(t)}finally{Ne=n}},{name:"sub"})},Nt.prototype.valueOf=function(){return this.value},Nt.prototype.toString=function(){return this.value+""},Nt.prototype.toJSON=function(){return this.value},Nt.prototype.peek=function(){const e=Ne;Ne=void 0;try{return this.value}finally{Ne=e}},Object.defineProperty(Nt.prototype,"value",{get(){const e=ay(this);return e!==void 0&&(e.i=this.i),this.v},set(e){if(e!==this.v){if(nf>100)throw new Error("Cycle detected");this.v=e,this.i++,al++,ki++;try{for(let t=this.t;t!==void 0;t=t.x)t.t.N()}finally{Uh()}}}}),Jo.prototype=new Nt,Jo.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===al))return!0;if(this.g=al,this.f|=1,this.i>0&&!dw(this))return this.f&=-2,!0;const e=Ne;try{ly(this),Ne=this;const t=this.x();(16&this.f||this.v!==t||this.i===0)&&(this.v=t,this.f&=-17,this.i++)}catch(t){this.v=t,this.f|=16,this.i++}return Ne=e,fw(this),this.f&=-2,!0},Jo.prototype.S=function(e){if(this.t===void 0){this.f|=36;for(let t=this.s;t!==void 0;t=t.n)t.S.S(t)}Nt.prototype.S.call(this,e)},Jo.prototype.U=function(e){if(this.t!==void 0&&(Nt.prototype.U.call(this,e),this.t===void 0)){this.f&=-33;for(let t=this.s;t!==void 0;t=t.n)t.S.U(t)}},Jo.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(let e=this.t;e!==void 0;e=e.x)e.t.N()}},Object.defineProperty(Jo.prototype,"value",{get(){if(1&this.f)throw new Error("Cycle detected");const e=ay(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}}),di.prototype.c=function(){const e=this.S();try{if(8&this.f||this.x===void 0)return;const t=this.x();typeof t=="function"&&(this.u=t)}finally{e()}},di.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,hw(this),ly(this),ki++;const e=Ne;return Ne=this,iN.bind(this,e)},di.prototype.N=function(){2&this.f||(this.f|=2,this.o=Ms,Ms=this)},di.prototype.d=function(){this.f|=8,1&this.f||Gh(this)},di.prototype.dispose=function(){this.d()};function aN(e){return(typeof e.nodes=="function"?e.nodes():e.nodes)||[]}function Ie(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const o of t)r.append("v",o);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function gw(e,t){if(e&&t&&!Array.isArray(t)&&typeof e=="object"&&typeof t=="object"){const n=e,r=t;for(const o in r)n[o]=gw(n[o],r[o]);return e}return t}const qh=0,rf=1,pw=2,uu=3,Fa=4,Qo=5,du=6,us=7;function fu(e){return e.id===qh}function mw(e){return e.id===pw}function lN(e){return(function(t){return t.id===rf})(e)||Ie(305,String(e.id),String(rf)),Object.assign(e,{id:pw})}const cN=new Set;let uN=class{builder;configs;_dependency;_peerNameSet;extension;state;_signal;constructor(t,n){this.builder=t,this.extension=n,this.configs=new Set,this.state={id:qh}}mergeConfigs(){let t=this.extension.config||{};const n=this.extension.mergeConfig?this.extension.mergeConfig.bind(this.extension):UA;for(const r of this.configs)t=n(t,r);return t}init(t){const n=this.state;mw(n)||Ie(306,String(n.id));const r={getDependency:this.getInitDependency.bind(this),getDirectDependentNames:this.getDirectDependentNames.bind(this),getPeer:this.getInitPeer.bind(this),getPeerNameSet:this.getPeerNameSet.bind(this)},o={...r,getDependency:this.getDependency.bind(this),getInitResult:this.getInitResult.bind(this),getPeer:this.getPeer.bind(this)},i=(function(a,l,c){return Object.assign(a,{config:l,id:uu,registerState:c})})(n,this.mergeConfigs(),r);let s;this.state=i,this.extension.init&&(s=this.extension.init(t,i.config,r)),this.state=(function(a,l,c){return Object.assign(a,{id:Fa,initResult:l,registerState:c})})(i,s,o)}build(t){const n=this.state;let r;n.id!==Fa&&Ie(307,String(n.id),String(Qo)),this.extension.build&&(r=this.extension.build(t,n.config,n.registerState));const o={...n.registerState,getOutput:()=>r,getSignal:this.getSignal.bind(this)};this.state=(function(i,s,a){return Object.assign(i,{id:Qo,output:s,registerState:a})})(n,r,o)}register(t,n){this._signal=n;const r=this.state;r.id!==Qo&&Ie(308,String(r.id),String(Qo));const o=this.extension.register&&this.extension.register(t,r.config,r.registerState);return this.state=(function(i){return Object.assign(i,{id:du})})(r),()=>{const i=this.state;i.id!==us&&Ie(309,String(r.id),String(us)),this.state=(function(s){return Object.assign(s,{id:Qo})})(i),o&&o()}}afterRegistration(t){const n=this.state;let r;return n.id!==du&&Ie(310,String(n.id),String(du)),this.extension.afterRegistration&&(r=this.extension.afterRegistration(t,n.config,n.registerState)),this.state=(function(o){return Object.assign(o,{id:us})})(n),r}getSignal(){return this._signal===void 0&&Ie(311),this._signal}getInitResult(){this.extension.init===void 0&&Ie(312,this.extension.name);const t=this.state;return(function(n){return n.id>=Fa})(t)||Ie(313,String(t.id),String(Fa)),t.initResult}getInitPeer(t){const n=this.builder.extensionNameMap.get(t);return n?n.getExtensionInitDependency():void 0}getExtensionInitDependency(){const t=this.state;return(function(n){return n.id>=uu})(t)||Ie(314,String(t.id),String(uu)),{config:t.config}}getPeer(t){const n=this.builder.extensionNameMap.get(t);return n?n.getExtensionDependency():void 0}getInitDependency(t){const n=this.builder.getExtensionRep(t);return n===void 0&&Ie(315,this.extension.name,t.name),n.getExtensionInitDependency()}getDependency(t){const n=this.builder.getExtensionRep(t);return n===void 0&&Ie(315,this.extension.name,t.name),n.getExtensionDependency()}getState(){const t=this.state;return(function(n){return n.id>=us})(t)||Ie(316,String(t.id),String(us)),t}getDirectDependentNames(){return this.builder.incomingEdges.get(this.extension.name)||cN}getPeerNameSet(){let t=this._peerNameSet;return t||(t=new Set((this.extension.peerDependencies||[]).map(([n])=>n)),this._peerNameSet=t),t}getExtensionDependency(){if(!this._dependency){const t=this.state;(function(n){return n.id>=Qo})(t)||Ie(317,this.extension.name),this._dependency={config:t.config,init:t.initResult,output:t.output}}return this._dependency}};const cy={tag:Ei};function dN(){const e=qe();e.isEmpty()&&e.append(ve())}const fN={config:{setOptions:cy,updateOptions:cy},init:({$initialEditorState:e=dN})=>({$initialEditorState:e,initialized:!1}),afterRegistration(e,{updateOptions:t,setOptions:n},r){const o=r.getInitResult();if(!o.initialized){o.initialized=!0;const{$initialEditorState:i}=o;if(pA(i))e.setEditorState(i,n);else if(typeof i=="function")e.update(()=>{i(e)},t);else if(i&&(typeof i=="string"||typeof i=="object")){const s=e.parseEditorState(i);e.setEditorState(s,n)}}return()=>{}},name:"@lexical/extension/InitialState",nodes:[Xi,fn,Ui,Gi,Wo]},uy=Symbol.for("@lexical/extension/LexicalBuilder");function dy(){}function hN(e){throw e}function $a(e){return Array.isArray(e)?e:[e]}const hu="0.39.0+prod.esm";let gN=class ll{roots;extensionNameMap;outgoingConfigEdges;incomingEdges;conflicts;_sortedExtensionReps;PACKAGE_VERSION;constructor(t){this.outgoingConfigEdges=new Map,this.incomingEdges=new Map,this.extensionNameMap=new Map,this.conflicts=new Map,this.PACKAGE_VERSION=hu,this.roots=t;for(const n of t)this.addExtension(n)}static fromExtensions(t){const n=[$a(fN)];for(const r of t)n.push($a(r));return new ll(n)}static maybeFromEditor(t){const n=t[uy];return n&&(n.PACKAGE_VERSION!==hu&&Ie(292,n.PACKAGE_VERSION,hu),n instanceof ll||Ie(293)),n}static fromEditor(t){const n=ll.maybeFromEditor(t);return n===void 0&&Ie(294),n}constructEditor(){const{$initialEditorState:t,onError:n,...r}=this.buildCreateEditorArgs(),o=Object.assign(E1({...r,...n?{onError:i=>{n(i,o)}}:{}}),{[uy]:this});for(const i of this.sortedExtensionReps())i.build(o);return o}buildEditor(){let t=dy;function n(){try{t()}finally{t=dy}}const r=Object.assign(this.constructEditor(),{dispose:n,[Symbol.dispose]:n});return t=Nn(this.registerEditor(r),()=>r.setRootElement(null)),r}hasExtensionByName(t){return this.extensionNameMap.has(t)}getExtensionRep(t){const n=this.extensionNameMap.get(t.name);if(n)return n.extension!==t&&Ie(295,t.name),n}addEdge(t,n,r){const o=this.outgoingConfigEdges.get(t);o?o.set(n,r):this.outgoingConfigEdges.set(t,new Map([[n,r]]));const i=this.incomingEdges.get(n);i?i.add(t):this.incomingEdges.set(n,new Set([t]))}addExtension(t){this._sortedExtensionReps!==void 0&&Ie(296);const n=$a(t),[r]=n;typeof r.name!="string"&&Ie(297,typeof r.name);let o=this.extensionNameMap.get(r.name);if(o!==void 0&&o.extension!==r&&Ie(298,r.name),!o){o=new uN(this,r),this.extensionNameMap.set(r.name,o);const i=this.conflicts.get(r.name);typeof i=="string"&&Ie(299,r.name,i);for(const s of r.conflictsWith||[])this.extensionNameMap.has(s)&&Ie(299,r.name,s),this.conflicts.set(s,r.name);for(const s of r.dependencies||[]){const a=$a(s);this.addEdge(r.name,a[0].name,a.slice(1)),this.addExtension(a)}for(const[s,a]of r.peerDependencies||[])this.addEdge(r.name,s,a?[a]:[])}}sortedExtensionReps(){if(this._sortedExtensionReps)return this._sortedExtensionReps;const t=[],n=(r,o)=>{let i=r.state;if(mw(i))return;const s=r.extension.name;var a;fu(i)||Ie(300,s,o||"[unknown]"),fu(a=i)||Ie(304,String(a.id),String(qh)),i=Object.assign(a,{id:rf}),r.state=i;const l=this.outgoingConfigEdges.get(s);if(l)for(const c of l.keys()){const u=this.extensionNameMap.get(c);u&&n(u,s)}i=lN(i),r.state=i,t.push(r)};for(const r of this.extensionNameMap.values())fu(r.state)&&n(r);for(const r of t)for(const[o,i]of this.outgoingConfigEdges.get(r.extension.name)||[])if(i.length>0){const s=this.extensionNameMap.get(o);if(s)for(const a of i)s.configs.add(a)}for(const[r,...o]of this.roots)if(o.length>0){const i=this.extensionNameMap.get(r.name);i===void 0&&Ie(301,r.name);for(const s of o)i.configs.add(s)}return this._sortedExtensionReps=t,this._sortedExtensionReps}registerEditor(t){const n=this.sortedExtensionReps(),r=new AbortController,o=[()=>r.abort()],i=r.signal;for(const s of n){const a=s.register(t,i);a&&o.push(a)}for(const s of n){const a=s.afterRegistration(t);a&&o.push(a)}return Nn(...o)}buildCreateEditorArgs(){const t={},n=new Set,r=new Map,o=new Map,i={},s={},a=this.sortedExtensionReps();for(const u of a){const{extension:f}=u;if(f.onError!==void 0&&(t.onError=f.onError),f.disableEvents!==void 0&&(t.disableEvents=f.disableEvents),f.parentEditor!==void 0&&(t.parentEditor=f.parentEditor),f.editable!==void 0&&(t.editable=f.editable),f.namespace!==void 0&&(t.namespace=f.namespace),f.$initialEditorState!==void 0&&(t.$initialEditorState=f.$initialEditorState),f.nodes)for(const d of aN(f)){if(typeof d!="function"){const h=r.get(d.replace);h&&Ie(302,f.name,d.replace.name,h.extension.name),r.set(d.replace,u)}n.add(d)}if(f.html){if(f.html.export)for(const[d,h]of f.html.export.entries())o.set(d,h);f.html.import&&Object.assign(i,f.html.import)}f.theme&&gw(s,f.theme)}Object.keys(s).length>0&&(t.theme=s),n.size&&(t.nodes=[...n]);const l=Object.keys(i).length>0,c=o.size>0;(l||c)&&(t.html={},l&&(t.html.import=i),c&&(t.html.export=o));for(const u of a)u.init(t);return t.onError||(t.onError=hN),t}},Yh=class yw extends ia{static getType(){return"horizontalrule"}static clone(t){return new yw(t.__key)}static importJSON(t){return vw().updateFromJSON(t)}static importDOM(){return{hr:()=>({conversion:pN,priority:0})}}exportDOM(){return{element:document.createElement("hr")}}createDOM(t){const n=document.createElement("hr");return et(n,t.theme.hr),n}getTextContent(){return`
45
+ `}isInline(){return!1}updateDOM(){return!1}};function pN(){return{node:vw()}}function vw(){return H1(Yh)}function mN(e){return e instanceof Yh}function Lr(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const o of t)r.append("v",o);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function of(e){let t=1,n=e.getParent();for(;n!=null;){if(ke(n)){const r=n.getParent();if(pe(r)){t++,n=r.getParent();continue}Lr(40)}return t}return t}function sf(e){let t=e.getParent();pe(t)||Lr(40);let n=t;for(;n!==null;)n=n.getParent(),pe(n)&&(t=n);return t}function xw(e){let t=[];const n=e.getChildren().filter(ke);for(let r=0;r<n.length;r++){const o=n[r],i=o.getFirstChild();pe(i)?t=t.concat(xw(i)):t.push(o)}return t}function jn(e){return ke(e)&&pe(e.getFirstChild())}function fy(e){return Zt().append(e)}function bw(e,t){return ke(e)&&(t.length===0||t.length===1&&e.is(t[0])&&e.getChildrenSize()===0)}function hy(e){const t=X();if(t!==null){let n=t.getNodes();if(W(t)){const o=t.getStartEndPoints();o===null&&Lr(143);const[i]=o,s=i.getNode(),a=s.getParent();if(vt(s)){const l=s.getFirstChild();if(l)n=l.selectStart().getNodes();else{const c=ve();s.append(c),n=c.select().getNodes()}}else if(bw(s,n)){const l=Ht(e);if(vt(a)){s.replace(l);const c=Zt();B(s)&&(c.setFormat(s.getFormatType()),c.setIndent(s.getIndent())),l.append(c)}else if(ke(s)){const c=s.getParentOrThrow();Io(l,c.getChildren()),c.replace(l)}return}}const r=new Set;for(let o=0;o<n.length;o++){const i=n[o];if(B(i)&&i.isEmpty()&&!ke(i)&&!r.has(i.getKey())){gy(i,e);continue}let s=M1(i)?i.getParent():ke(i)&&i.isEmpty()?i:null;for(;s!=null;){const a=s.getKey();if(pe(s)){if(!r.has(a)){const l=Ht(e);Io(l,s.getChildren()),s.replace(l),r.add(a)}break}{const l=s.getParent();if(vt(l)&&!r.has(a)){r.add(a),gy(s,e);break}s=l}}}}}function Io(e,t){e.splice(e.getChildrenSize(),0,t)}function gy(e,t){if(pe(e))return e;const n=e.getPreviousSibling(),r=e.getNextSibling(),o=Zt();let i;if(Io(o,e.getChildren()),pe(n)&&t===n.getListType())n.append(o),pe(r)&&t===r.getListType()&&(Io(n,r.getChildren()),r.remove()),i=n;else if(pe(r)&&t===r.getListType())r.getFirstChildOrThrow().insertBefore(o),i=r;else{const s=Ht(t);s.append(o),e.replace(s),i=s}return o.setFormat(e.getFormatType()),o.setIndent(e.getIndent()),e.remove(),i}function Xh(e,t){const n=e.getLastChild(),r=t.getFirstChild();n&&r&&jn(n)&&jn(r)&&(Xh(n.getFirstChild(),r.getFirstChild()),r.remove());const o=t.getChildren();o.length>0&&e.append(...o),t.remove()}function yN(){const e=X();if(W(e)){const t=new Set,n=e.getNodes(),r=e.anchor.getNode();if(bw(r,n))t.add(sf(r));else for(let o=0;o<n.length;o++){const i=n[o];if(M1(i)){const s=ZA(i,eo);s!=null&&t.add(sf(s))}}for(const o of t){let i=o;const s=xw(o);for(const a of s){const l=ve().setTextStyle(e.style).setTextFormat(e.format);Io(l,a.getChildren()),i.insertAfter(l),i=l,a.__key===e.anchor.key&&Sn(e.anchor,Lt(Ft(l,"next"))),a.__key===e.focus.key&&Sn(e.focus,Lt(Ft(l,"next"))),a.remove()}o.remove()}}}function ww(e){const t=e.getListType()!=="check";let n=e.getStart();for(const r of e.getChildren())ke(r)&&(r.getValue()!==n&&r.setValue(n),t&&r.getLatest().__checked!=null&&r.setChecked(void 0),pe(r.getFirstChild())||n++)}function vN(e){const t=new Set;if(jn(e)||t.has(e.getKey()))return;const n=e.getParent(),r=e.getNextSibling(),o=e.getPreviousSibling();if(jn(r)&&jn(o)){const i=o.getFirstChild();if(pe(i)){i.append(e);const s=r.getFirstChild();pe(s)&&(Io(i,s.getChildren()),r.remove(),t.add(r.getKey()))}}else if(jn(r)){const i=r.getFirstChild();if(pe(i)){const s=i.getFirstChild();s!==null&&s.insertBefore(e)}}else if(jn(o)){const i=o.getFirstChild();pe(i)&&i.append(e)}else if(pe(n)){const i=Zt().setTextFormat(e.getTextFormat()).setTextStyle(e.getTextStyle()),s=Ht(n.getListType()).setTextFormat(n.getTextFormat()).setTextStyle(n.getTextStyle());i.append(s),s.append(e),o?o.insertAfter(i):r?r.insertBefore(i):n.append(i)}}function xN(e){if(jn(e))return;const t=e.getParent(),n=t?t.getParent():void 0;if(pe(n?n.getParent():void 0)&&ke(n)&&pe(t)){const r=t?t.getFirstChild():void 0,o=t?t.getLastChild():void 0;if(e.is(r))n.insertBefore(e),t.isEmpty()&&n.remove();else if(e.is(o))n.insertAfter(e),t.isEmpty()&&n.remove();else{const i=t.getListType(),s=Zt(),a=Ht(i);s.append(a),e.getPreviousSiblings().forEach(u=>a.append(u));const l=Zt(),c=Ht(i);l.append(c),Io(c,e.getNextSiblings()),n.insertBefore(s),n.insertAfter(l),n.replace(e)}}}function bN(){const e=X();if(!W(e)||!e.isCollapsed())return!1;const t=e.anchor.getNode();if(!ke(t)||t.getChildrenSize()!==0)return!1;const n=sf(t),r=t.getParent();pe(r)||Lr(40);const o=r.getParent();let i;if(vt(o))i=ve(),n.insertAfter(i);else{if(!ke(o))return!1;i=Zt(),o.insertAfter(i)}i.setTextStyle(e.style).setTextFormat(e.format).select();const s=t.getNextSiblings();if(s.length>0){const a=Ht(r.getListType());if(ke(i)){const l=Zt();l.append(a),i.insertAfter(l)}else i.insertAfter(a);a.append(...s)}return(function(a){let l=a;for(;l.getNextSibling()==null&&l.getPreviousSibling()==null;){const c=l.getParent();if(c==null||!ke(c)&&!pe(c))break;l=c}l.remove()})(t),!0}function Fl(...e){const t=[];for(const n of e)if(n&&typeof n=="string")for(const[r]of n.matchAll(/\S+/g))t.push(r);return t}let eo=class extends Tt{__value;__checked;$config(){return this.config("listitem",{$transform:t=>{if(t.__checked==null)return;const n=t.getParent();pe(n)&&n.getListType()!=="check"&&t.getChecked()!=null&&t.setChecked(void 0)},extends:Tt,importDOM:{li:()=>({conversion:wN,priority:0})}})}constructor(t=1,n=void 0,r){super(r),this.__value=t===void 0?1:t,this.__checked=n}afterCloneFrom(t){super.afterCloneFrom(t),this.__value=t.__value,this.__checked=t.__checked}createDOM(t){const n=document.createElement("li");return this.updateListItemDOM(null,n,t),n}updateListItemDOM(t,n,r){(function(s,a,l){const c=a.getParent();!pe(c)||c.getListType()!=="check"||pe(a.getFirstChild())?(s.removeAttribute("role"),s.removeAttribute("tabIndex"),s.removeAttribute("aria-checked")):(s.setAttribute("role","checkbox"),s.setAttribute("tabIndex","-1"),l&&a.__checked===l.__checked||s.setAttribute("aria-checked",a.getChecked()?"true":"false"))})(n,this,t),n.value=this.__value,(function(s,a,l){const c=[],u=[],f=a.list,d=f?f.listitem:void 0;let h;if(f&&f.nested&&(h=f.nested.listitem),d!==void 0&&c.push(...Fl(d)),f){const g=l.getParent(),p=pe(g)&&g.getListType()==="check",m=l.getChecked();p&&!m||u.push(f.listitemUnchecked),p&&m||u.push(f.listitemChecked),p&&c.push(m?f.listitemChecked:f.listitemUnchecked)}if(h!==void 0){const g=Fl(h);l.getChildren().some(p=>pe(p))?c.push(...g):u.push(...g)}u.length>0&&Yn(s,...u),c.length>0&&et(s,...c)})(n,r.theme,this);const o=t?t.__style:"",i=this.__style;o!==i&&(i===""?n.removeAttribute("style"):n.style.cssText=i),(function(s,a,l){const c=ny(a.__textStyle);for(const u in c)s.style.setProperty(`--listitem-marker-${u}`,c[u]);if(l)for(const u in ny(l.__textStyle))u in c||s.style.removeProperty(`--listitem-marker-${u}`)})(n,this,t)}updateDOM(t,n,r){const o=n;return this.updateListItemDOM(t,o,r),!1}updateFromJSON(t){return super.updateFromJSON(t).setValue(t.value).setChecked(t.checked)}exportDOM(t){const n=this.createDOM(t._config),r=this.getFormatType();r&&(n.style.textAlign=r);const o=this.getDirection();return o&&(n.dir=o),{element:n}}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),value:this.getValue()}}append(...t){for(let n=0;n<t.length;n++){const r=t[n];if(B(r)&&this.canMergeWith(r)){const o=r.getChildren();this.append(...o),r.remove()}else super.append(r)}return this}replace(t,n){if(ke(t))return super.replace(t);this.setIndent(0);const r=this.getParentOrThrow();if(!pe(r))return t;if(r.__first===this.getKey())r.insertBefore(t);else if(r.__last===this.getKey())r.insertAfter(t);else{const o=Ht(r.getListType());let i=this.getNextSibling();for(;i;){const s=i;i=i.getNextSibling(),o.append(s)}r.insertAfter(t),t.insertAfter(o)}return n&&(B(t)||Lr(139),this.getChildren().forEach(o=>{t.append(o)})),this.remove(),r.getChildrenSize()===0&&r.remove(),t}insertAfter(t,n=!0){const r=this.getParentOrThrow();if(pe(r)||Lr(39),ke(t))return super.insertAfter(t,n);const o=this.getNextSiblings();if(r.insertAfter(t,n),o.length!==0){const i=Ht(r.getListType());o.forEach(s=>i.append(s)),t.insertAfter(i,n)}return t}remove(t){const n=this.getPreviousSibling(),r=this.getNextSibling();super.remove(t),n&&r&&jn(n)&&jn(r)&&(Xh(n.getFirstChild(),r.getFirstChild()),r.remove())}insertNewAfter(t,n=!0){const r=Zt().updateFromJSON(this.exportJSON()).setChecked(!this.getChecked()&&void 0);return this.insertAfter(r,n),r}collapseAtStart(t){const n=ve();this.getChildren().forEach(s=>n.append(s));const r=this.getParentOrThrow(),o=r.getParentOrThrow(),i=ke(o);if(r.getChildrenSize()===1)if(i)r.remove(),o.select();else{r.insertBefore(n),r.remove();const s=t.anchor,a=t.focus,l=n.getKey();s.type==="element"&&s.getNode().is(this)&&s.set(l,s.offset,"element"),a.type==="element"&&a.getNode().is(this)&&a.set(l,a.offset,"element")}else r.insertBefore(n),this.remove();return!0}getValue(){return this.getLatest().__value}setValue(t){const n=this.getWritable();return n.__value=t,n}getChecked(){const t=this.getLatest();let n;const r=this.getParent();return pe(r)&&(n=r.getListType()),n==="check"?!!t.__checked:void 0}setChecked(t){const n=this.getWritable();return n.__checked=t,n}toggleChecked(){const t=this.getWritable();return t.setChecked(!t.__checked)}getIndent(){const t=this.getParent();if(t===null||!this.isAttached())return this.getLatest().__indent;let n=t.getParentOrThrow(),r=0;for(;ke(n);)n=n.getParentOrThrow().getParentOrThrow(),r++;return r}setIndent(t){typeof t!="number"&&Lr(117),(t=Math.floor(t))>=0||Lr(199);let n=this.getIndent();for(;n!==t;)n<t?(vN(this),n++):(xN(this),n--);return this}canInsertAfter(t){return ke(t)}canReplaceWith(t){return ke(t)}canMergeWith(t){return ke(t)||Qr(t)}extractWithChild(t,n){if(!W(n))return!1;const r=n.anchor.getNode(),o=n.focus.getNode();return this.isParentOf(r)&&this.isParentOf(o)&&this.getTextContent().length===n.getTextContent().length}isParentRequired(){return!0}createParentElementNode(){return Ht("bullet")}canMergeWhenEmpty(){return!0}};function wN(e){if(e.classList.contains("task-list-item")){for(const n of e.children)if(n.tagName==="INPUT")return py(n)}if(e.classList.contains("joplin-checkbox")){for(const n of e.children)if(n.classList.contains("checkbox-wrapper")&&n.children.length>0&&n.children[0].tagName==="INPUT")return py(n.children[0])}const t=e.getAttribute("aria-checked");return{node:Zt(t==="true"||t!=="false"&&void 0)}}function py(e){return e.getAttribute("type")!=="checkbox"?{node:null}:{node:Zt(e.hasAttribute("checked"))}}function Zt(e){return Et(new eo(void 0,e))}function ke(e){return e instanceof eo}let Uo=class extends Tt{__tag;__start;__listType;$config(){return this.config("list",{$transform:t=>{(function(n){const r=n.getNextSibling();pe(r)&&n.getListType()===r.getListType()&&Xh(n,r)})(t),ww(t)},extends:Tt,importDOM:{ol:()=>({conversion:yy,priority:0}),ul:()=>({conversion:yy,priority:0})}})}constructor(t="number",n=1,r){super(r);const o=SN[t]||t;this.__listType=o,this.__tag=o==="number"?"ol":"ul",this.__start=n}afterCloneFrom(t){super.afterCloneFrom(t),this.__listType=t.__listType,this.__tag=t.__tag,this.__start=t.__start}getTag(){return this.getLatest().__tag}setListType(t){const n=this.getWritable();return n.__listType=t,n.__tag=t==="number"?"ol":"ul",n}getListType(){return this.getLatest().__listType}getStart(){return this.getLatest().__start}setStart(t){const n=this.getWritable();return n.__start=t,n}createDOM(t,n){const r=this.__tag,o=document.createElement(r);return this.__start!==1&&o.setAttribute("start",String(this.__start)),o.__lexicalListType=this.__listType,my(o,t.theme,this),o}updateDOM(t,n,r){return t.__tag!==this.__tag||t.__listType!==this.__listType||(my(n,r.theme,this),!1)}updateFromJSON(t){return super.updateFromJSON(t).setListType(t.listType).setStart(t.start)}exportDOM(t){const n=this.createDOM(t._config,t);return Be(n)&&(this.__start!==1&&n.setAttribute("start",String(this.__start)),this.__listType==="check"&&n.setAttribute("__lexicalListType","check")),{element:n}}exportJSON(){return{...super.exportJSON(),listType:this.getListType(),start:this.getStart(),tag:this.getTag()}}canBeEmpty(){return!1}canIndent(){return!1}splice(t,n,r){let o=r;for(let i=0;i<r.length;i++){const s=r[i];ke(s)||(o===r&&(o=[...r]),o[i]=Zt().append(!B(s)||pe(s)||s.isInline()?s:Fe(s.getTextContent())))}return super.splice(t,n,o)}extractWithChild(t){return ke(t)}};function my(e,t,n){const r=[],o=[],i=t.list;if(i!==void 0){const s=i[`${n.__tag}Depth`]||[],a=of(n)-1,l=a%s.length,c=s[l],u=i[n.__tag];let f;const d=i.nested,h=i.checklist;if(d!==void 0&&d.list&&(f=d.list),u!==void 0&&r.push(u),h!==void 0&&n.__listType==="check"&&r.push(h),c!==void 0){r.push(...Fl(c));for(let g=0;g<s.length;g++)g!==l&&o.push(n.__tag+g)}if(f!==void 0){const g=Fl(f);a>1?r.push(...g):o.push(...g)}}o.length>0&&Yn(e,...o),r.length>0&&et(e,...r)}function CN(e){const t=[];for(let n=0;n<e.length;n++){const r=e[n];if(ke(r)){t.push(r);const o=r.getChildren();o.length>1&&o.forEach(i=>{pe(i)&&t.push(fy(i))})}else t.push(fy(r))}return t}function yy(e){const t=e.nodeName.toLowerCase();let n=null;return t==="ol"?n=Ht("number",e.start):t==="ul"&&(n=(function(r){if(r.getAttribute("__lexicallisttype")==="check"||r.classList.contains("contains-task-list")||r.getAttribute("data-is-checklist")==="1")return!0;for(const o of r.childNodes)if(Be(o)&&o.hasAttribute("aria-checked"))return!0;return!1})(e)?Ht("check"):Ht("bullet")),{after:CN,node:n}}const SN={ol:"number",ul:"bullet"};function Ht(e="number",t=1){return Et(new Uo(e,t))}function pe(e){return e instanceof Uo}const _N=ce("UPDATE_LIST_START_COMMAND"),Cw=ce("INSERT_UNORDERED_LIST_COMMAND"),Sw=ce("INSERT_ORDERED_LIST_COMMAND"),TN=ce("REMOVE_LIST_COMMAND");function EN(e){return Nn(e.registerCommand(Sw,()=>(hy("number"),!0),ur),e.registerCommand(_N,t=>{const{listNodeKey:n,newStart:r}=t,o=Pe(n);return!!pe(o)&&(o.getListType()==="number"&&(o.setStart(r),ww(o)),!0)},ur),e.registerCommand(Cw,()=>(hy("bullet"),!0),ur),e.registerCommand(TN,()=>(yN(),!0),ur),e.registerCommand(Mo,()=>bN(),ur),e.registerNodeTransform(eo,t=>{const n=t.getFirstChild();if(n){if(J(n)){const r=n.getStyle(),o=n.getFormat();t.getTextStyle()!==r&&t.setTextStyle(r),t.getTextFormat()!==o&&t.setTextFormat(o)}}else{const r=X();W(r)&&(r.style!==t.getTextStyle()||r.format!==t.getTextFormat())&&r.isCollapsed()&&t.is(r.anchor.getNode())&&t.setTextStyle(r.style).setTextFormat(r.format)}}),e.registerNodeTransform(fn,t=>{const n=t.getParent();if(ke(n)&&t.is(n.getFirstChild())){const r=t.getStyle(),o=t.getFormat();r===n.getTextStyle()&&o===n.getTextFormat()||n.setTextStyle(r).setTextFormat(o)}}))}function RN(e){const t=n=>{const r=n.getParent();if(pe(n.getFirstChild())||!pe(r))return;const o=we(n,i=>ke(i)&&pe(i.getParent())&&ke(i.getPreviousSibling()));if(o===null&&n.getIndent()>0)n.setIndent(0);else if(ke(o)){const i=o.getPreviousSibling();if(ke(i)){const s=(function(l){let c=l,u=c.getFirstChild();for(;pe(u);){const f=u.getLastChild();if(!ke(f))break;c=f,u=c.getFirstChild()}return c})(i),a=s.getParent();if(pe(a)){const l=of(a);l+1<of(r)&&n.setIndent(l)}}}};return e.registerNodeTransform(Uo,n=>{const r=[n];for(;r.length>0;){const o=r.shift();if(pe(o)){for(const i of o.getChildren())if(ke(i)){t(i);const s=i.getFirstChild();pe(s)&&r.push(s)}}}})}function kN(e,t){const n=N1(t)?t.body.childNodes:t.childNodes;let r=[];const o=[];for(const i of n)if(!Tw.has(i.nodeName)){const s=Ew(i,e,o,!1);s!==null&&(r=r.concat(s))}return(function(i){for(const s of i)s.getNextSibling()instanceof Nh&&s.insertAfter(kn());for(const s of i){const a=s.getChildren();for(const l of a)s.insertBefore(l);s.remove()}})(o),r}function AN(e,t){if(typeof document>"u"||typeof window>"u"&&global.window===void 0)throw new Error("To use $generateHtmlFromNodes in headless mode please initialize a headless browser implementation such as JSDom before calling this function.");const n=document.createElement("div"),r=qe().getChildren();for(let o=0;o<r.length;o++)_w(e,r[o],n,t);return n.innerHTML}function _w(e,t,n,r=null){let o=r===null||t.isSelected(r);const i=B(t)&&t.excludeFromCopy("html");let s=t;r!==null&&J(t)&&(s=J1(r,t,"clone"));const a=B(s)?s.getChildren():[],l=Ph(e,s.getType());let c;c=l&&l.exportDOM!==void 0?l.exportDOM(e,s):s.exportDOM(e);const{element:u,after:f}=c;if(!u)return!1;const d=document.createDocumentFragment();for(let h=0;h<a.length;h++){const g=a[h],p=_w(e,g,d,r);!o&&B(t)&&p&&t.extractWithChild(g,r,"html")&&(o=!0)}if(o&&!i){if((Be(u)||Qd(u))&&u.append(d),n.append(u),f){const h=f.call(s,u);h&&(Qd(u)?u.replaceChildren(h):u.replaceWith(h))}}else n.append(d);return o}const Tw=new Set(["STYLE","SCRIPT"]);function Ew(e,t,n,r,o=new Map,i){let s=[];if(Tw.has(e.nodeName))return s;let a=null;const l=(function(g,p){const{nodeName:m}=g,v=p._htmlConversions.get(m.toLowerCase());let y=null;if(v!==void 0)for(const x of v){const b=x(g);b!==null&&(y===null||(y.priority||0)<=(b.priority||0))&&(y=b)}return y!==null?y.conversion:null})(e,t),c=l?l(e):null;let u=null;if(c!==null){u=c.after;const g=c.node;if(a=Array.isArray(g)?g[g.length-1]:g,a!==null){for(const[,p]of o)if(a=p(a,i),!a)break;a&&s.push(...Array.isArray(g)?g:[a])}c.forChild!=null&&o.set(e.nodeName,c.forChild)}const f=e.childNodes;let d=[];const h=(a==null||!vt(a))&&(a!=null&&qd(a)||r);for(let g=0;g<f.length;g++)d.push(...Ew(f[g],t,n,h,new Map(o),a));return u!=null&&(d=u(d)),Ll(e)&&(d=NN(e,d,h?()=>{const g=new Nh;return n.push(g),g}:ve)),a==null?d.length>0?s=s.concat(d):Ll(e)&&(function(g){return g.nextSibling==null||g.previousSibling==null?!1:ef(g.nextSibling)&&ef(g.previousSibling)})(e)&&(s=s.concat(kn())):B(a)&&a.append(...d),s}function NN(e,t,n){const r=e.style.textAlign,o=[];let i=[];for(let s=0;s<t.length;s++){const a=t[s];if(qd(a))r&&!a.getFormat()&&a.setFormat(r),o.push(a);else if(i.push(a),s===t.length-1||s<t.length-1&&qd(t[s+1])){const l=n();l.setFormat(r),l.append(...i),o.push(l),i=[]}}return o}function $l(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const o of t)r.append("v",o);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function MN(e,t=X()){return t==null&&$l(166),W(t)&&t.isCollapsed()||t.getNodes().length===0?"":AN(e,t)}function PN(e,t=X()){return t==null&&$l(166),W(t)&&t.isCollapsed()||t.getNodes().length===0?null:JSON.stringify(LN(e,t))}function vy(e,t,n){const r=e.getData("application/x-lexical-editor");if(r)try{const a=JSON.parse(r);if(a.namespace===n._config.namespace&&Array.isArray(a.nodes))return xy(n,FN(a.nodes),t)}catch(a){console.error(a)}const o=e.getData("text/html"),i=e.getData("text/plain");if(o&&i!==o)try{const a=new DOMParser().parseFromString((function(l){return window.trustedTypes&&window.trustedTypes.createPolicy?window.trustedTypes.createPolicy("lexical",{createHTML:c=>c}).createHTML(l):l})(o),"text/html");return xy(n,kN(n,a),t)}catch(a){console.error(a)}const s=i||e.getData("text/uri-list");if(s!=null)if(W(t)){const a=s.split(/(\r?\n|\t)/);a[a.length-1]===""&&a.pop();for(let l=0;l<a.length;l++){const c=X();if(W(c)){const u=a[l];u===`
46
46
  `||u===`\r
47
- `?c.insertParagraph():u===" "?c.insertNodes([Vi()]):c.insertText(u)}}}else t.insertRawText(s)}function my(e,t,n){e.dispatchCommand(lh,{nodes:t,selection:n})||(n.insertNodes(t),(function(r){if(W(r)&&r.isCollapsed()){const o=r.anchor;let i=null;const s=En(o,"previous");if(s)if(Wn(s))i=s.origin;else{const a=Br(s,Nt(qe(),"next").getFlipped());for(const l of a){if(X(l.origin)){i=l.origin;break}if(B(l.origin)&&!l.origin.isInline())break}}if(i&&X(i)){const a=i.getFormat(),l=i.getStyle();r.format===a&&r.style===l||(r.format=a,r.style=l,r.dirty=!0)}}})(n))}function Cw(e,t,n,r=[]){let o=t===null||n.isSelected(t);const i=B(n)&&n.excludeFromCopy("html");let s=n;t!==null&&X(s)&&(s=Gb(t,s,"clone"));const a=B(s)?s.getChildren():[],l=(function(c){const u=c.exportJSON(),f=c.constructor;if(u.type!==f.getType()&&Rl(58,f.name),B(c)){const d=u.children;Array.isArray(d)||Rl(59,f.name)}return u})(s);X(s)&&s.getTextContentSize()===0&&(o=!1);for(let c=0;c<a.length;c++){const u=a[c],f=Cw(e,t,u,l.children);!o&&B(n)&&f&&n.extractWithChild(u,t,"clone")&&(o=!0)}if(o&&!i)r.push(l);else if(Array.isArray(l.children))for(let c=0;c<l.children.length;c++){const u=l.children[c];r.push(u)}return o}function MM(e,t){const n=[],r=qe().getChildren();for(let o=0;o<r.length;o++)Cw(e,t,r[o],n);return{namespace:e._config.namespace,nodes:n}}function NM(e){const t=[];for(let n=0;n<e.length;n++){const r=e[n],o=dA(r);X(o)&&WA(o),t.push(o)}return t}let Ko=null;async function Zd(e,t,n){if(Ko!==null)return!1;if(t!==null)return new Promise((c,u)=>{e.update(()=>{c(yy(e,t,n))})});const r=e.getRootElement(),o=e._window||window,i=o.document,s=Lt(o);if(r===null||s===null)return!1;const a=i.createElement("span");a.style.cssText="position: fixed; top: -1000px;",a.append(i.createTextNode("#")),r.append(a);const l=new Range;return l.setStart(a,0),l.setEnd(a,1),s.removeAllRanges(),s.addRange(l),new Promise((c,u)=>{const f=e.registerCommand(Gl,d=>(Ar(d,ClipboardEvent)&&(f(),Ko!==null&&(o.clearTimeout(Ko),Ko=null),c(yy(e,d,n))),!0),gA);Ko=o.setTimeout(()=>{f(),Ko=null,c(!1)},50),i.execCommand("copy"),a.remove()})}function yy(e,t,n){if(n===void 0){const o=Lt(e._window),i=Y();if(!i||i.isCollapsed()||!o)return!1;const s=o.anchorNode,a=o.focusNode;if(s!==null&&a!==null&&!Qs(e,s,a))return!1;n=_w(i)}t.preventDefault();const r=t.clipboardData;return r!==null&&(PM(r,n),!0)}const Sw=[["text/html",kM],["application/x-lexical-editor",AM]];function _w(e=Y()){const t={"text/plain":e?e.getTextContent():""};if(e){const n=Hi();for(const[r,o]of Sw){const i=o(n,e);i!==null&&(t[r]=i)}}return t}function PM(e,t){for(const[n]of Sw)t[n]===void 0&&e.setData(n,"");for(const n in t){const r=t[n];r!==void 0&&e.setData(n,r)}}function LM(e){const t=window.location.origin,n=r=>{if(r.origin!==t)return;const o=e.getRootElement();if(document.activeElement!==o)return;const i=r.data;if(typeof i=="string"){let s;try{s=JSON.parse(i)}catch{return}if(s&&s.protocol==="nuanria_messaging"&&s.type==="request"){const a=s.payload;if(a&&a.functionId==="makeChanges"){const l=a.args;if(l){const[c,u,f,d,h]=l;e.update(()=>{const g=Y();if(W(g)){const p=g.anchor;let m=p.getNode(),x=0,y=0;if(X(m)&&c>=0&&u>=0&&(x=c,y=c+u,g.setTextNodeRange(m,x,m,y)),x===y&&f===""||(g.insertRawText(f),m=p.getNode()),X(m)){x=d,y=d+h;const v=m.getTextContentSize();x=x>v?v:x,y=y>v?v:y,g.setTextNodeRange(m,x,m,y)}r.stopImmediatePropagation()}})}}}}};return window.addEventListener("message",n,!0),()=>{window.removeEventListener("message",n,!0)}}function vy(e,t){if(document.caretRangeFromPoint!==void 0){const n=document.caretRangeFromPoint(e,t);return n===null?null:{node:n.startContainer,offset:n.startOffset}}if(document.caretPositionFromPoint!=="undefined"){const n=document.caretPositionFromPoint(e,t);return n===null?null:{node:n.offsetNode,offset:n.offset}}return null}const Vo=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,FM=Vo&&"documentMode"in document?document.documentMode:null,$M=Vo&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),OM=!(!Vo||!("InputEvent"in window)||FM)&&"getTargetRanges"in new window.InputEvent("input"),IM=Vo&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),xy=Vo&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,DM=Vo&&/^(?=.*Chrome).*/i.test(navigator.userAgent),jM=Vo&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&$M&&!DM,by=le("DRAG_DROP_PASTE_FILE");let oc=class Tw extends St{static getType(){return"quote"}static clone(t){return new Tw(t.__key)}createDOM(t){const n=document.createElement("blockquote");return Qe(n,t.theme.quote),n}updateDOM(t,n){return!1}static importDOM(){return{blockquote:t=>({conversion:VM,priority:0})}}exportDOM(t){const{element:n}=super.exportDOM(t);if(Be(n)){this.isEmpty()&&n.append(document.createElement("br"));const r=this.getFormatType();r&&(n.style.textAlign=r);const o=this.getDirection();o&&(n.dir=o)}return{element:n}}static importJSON(t){return Hh().updateFromJSON(t)}insertNewAfter(t,n){const r=ye(),o=this.getDirection();return r.setDirection(o),this.insertAfter(r,n),r}collapseAtStart(){const t=ye();return this.getChildren().forEach(n=>t.append(n)),this.replace(t),!0}canMergeWhenEmpty(){return!0}};function Hh(){return _t(new oc)}function Jd(e){return e instanceof oc}let ic=class Ew extends St{__tag;static getType(){return"heading"}static clone(t){return new Ew(t.__tag,t.__key)}constructor(t,n){super(n),this.__tag=t}getTag(){return this.__tag}setTag(t){const n=this.getWritable();return this.__tag=t,n}createDOM(t){const n=this.__tag,r=document.createElement(n),o=t.theme.heading;if(o!==void 0){const i=o[n];Qe(r,i)}return r}updateDOM(t,n,r){return t.__tag!==this.__tag}static importDOM(){return{h1:t=>({conversion:Uo,priority:0}),h2:t=>({conversion:Uo,priority:0}),h3:t=>({conversion:Uo,priority:0}),h4:t=>({conversion:Uo,priority:0}),h5:t=>({conversion:Uo,priority:0}),h6:t=>({conversion:Uo,priority:0}),p:t=>{const n=t.firstChild;return n!==null&&wy(n)?{conversion:()=>({node:null}),priority:3}:null},span:t=>wy(t)?{conversion:n=>({node:go("h1")}),priority:3}:null}}exportDOM(t){const{element:n}=super.exportDOM(t);if(Be(n)){this.isEmpty()&&n.append(document.createElement("br"));const r=this.getFormatType();r&&(n.style.textAlign=r);const o=this.getDirection();o&&(n.dir=o)}return{element:n}}static importJSON(t){return go(t.tag).updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setTag(t.tag)}exportJSON(){return{...super.exportJSON(),tag:this.getTag()}}insertNewAfter(t,n=!0){const r=t?t.anchor.offset:0,o=this.getLastDescendant(),i=!o||t&&t.anchor.key===o.getKey()&&r===o.getTextContentSize()||!t?ye():go(this.getTag()),s=this.getDirection();if(i.setDirection(s),this.insertAfter(i,n),r===0&&!this.isEmpty()&&t){const a=ye();a.select(),this.replace(a,!0)}return i}collapseAtStart(){const t=this.isEmpty()?ye():go(this.getTag());return this.getChildren().forEach(n=>t.append(n)),this.replace(t),!0}extractWithChild(){return!0}};function wy(e){return e.nodeName.toLowerCase()==="span"&&e.style.fontSize==="26pt"}function Uo(e){const t=e.nodeName.toLowerCase();let n=null;return t!=="h1"&&t!=="h2"&&t!=="h3"&&t!=="h4"&&t!=="h5"&&t!=="h6"||(n=go(t),e.style!==null&&(Ph(e,n),n.setFormat(e.style.textAlign))),{node:n}}function VM(e){const t=Hh();return e.style!==null&&(t.setFormat(e.style.textAlign),Ph(e,t)),{node:t}}function go(e="h1"){return _t(new ic(e))}function Rw(e){return e instanceof ic}function ka(e){let t=null;if(Ar(e,DragEvent)?t=e.dataTransfer:Ar(e,ClipboardEvent)&&(t=e.clipboardData),t===null)return[!1,[],!1];const n=t.types,r=n.includes("Files"),o=n.includes("text/html")||n.includes("text/plain");return[r,Array.from(t.files),o]}function Cy(e){const t=Y();if(!W(t))return!1;const n=new Set,r=t.getNodes();for(let o=0;o<r.length;o++){const i=r[o],s=i.getKey();if(n.has(s))continue;const a=we(i,c=>B(c)&&!c.isInline());if(a===null)continue;const l=a.getKey();a.canIndent()&&!n.has(l)&&(n.add(l),e(a))}return n.size>0}function Sy(e){const t=Ht(e);return _e(t)}function su(e){for(const t of["lowercase","uppercase","capitalize"])e.hasFormat(t)&&e.toggleFormat(t)}function BM(e){return Rn(e.registerCommand(Kl,t=>{const n=Y();return!!bt(n)&&(n.clear(),!0)},be),e.registerCommand(Fr,t=>{const n=Y();return W(n)?(n.deleteCharacter(t),!0):!!bt(n)&&(n.deleteNodes(),!0)},be),e.registerCommand(Ri,t=>{const n=Y();return!!W(n)&&(n.deleteWord(t),!0)},be),e.registerCommand(To,t=>{const n=Y();return!!W(n)&&(n.deleteLine(t),!0)},be),e.registerCommand(vo,t=>{const n=Y();if(typeof t=="string")n!==null&&n.insertText(t);else{if(n===null)return!1;const r=t.dataTransfer;if(r!=null)py(r,n,e);else if(W(n)){const o=t.data;return o&&n.insertText(o),!0}}return!0},be),e.registerCommand(Ad,()=>{const t=Y();return!!W(t)&&(t.removeText(),!0)},be),e.registerCommand(It,t=>{const n=Y();return!!W(n)&&(n.formatText(t),!0)},be),e.registerCommand(pi,t=>{const n=Y();if(!W(n)&&!bt(n))return!1;const r=n.getNodes();for(const o of r){const i=we(o,s=>B(s)&&!s.isInline());i!==null&&i.setFormat(t)}return!0},be),e.registerCommand(gi,t=>{const n=Y();return!!W(n)&&(n.insertLineBreak(t),!0)},be),e.registerCommand(_o,()=>{const t=Y();return!!W(t)&&(t.insertParagraph(),!0)},be),e.registerCommand(I3,()=>(xh([Vi()]),!0),be),e.registerCommand(D3,()=>Cy(t=>{const n=t.getIndent();t.setIndent(n+1)}),be),e.registerCommand(ym,()=>Cy(t=>{const n=t.getIndent();n>0&&t.setIndent(Math.max(0,n-1))}),be),e.registerCommand(fh,t=>{const n=Y();if(bt(n)){const r=n.getNodes();if(r.length>0)return t.preventDefault(),r[0].selectPrevious(),!0}else if(W(n)){const r=Bd(n.focus,!0);if(!t.shiftKey&&_e(r)&&!r.isIsolated()&&!r.isInline())return r.selectPrevious(),t.preventDefault(),!0}return!1},be),e.registerCommand(hh,t=>{const n=Y();if(bt(n)){const r=n.getNodes();if(r.length>0)return t.preventDefault(),r[0].selectNext(0,0),!0}else if(W(n)){if((function(o){const i=o.focus;return i.key==="root"&&i.offset===qe().getChildrenSize()})(n))return t.preventDefault(),!0;const r=Bd(n.focus,!1);if(!t.shiftKey&&_e(r)&&!r.isIsolated()&&!r.isInline())return r.selectNext(),t.preventDefault(),!0}return!1},be),e.registerCommand(dh,t=>{const n=Y();if(bt(n)){const r=n.getNodes();if(r.length>0)return t.preventDefault(),ey(r[0])?r[0].selectNext(0,0):r[0].selectPrevious(),!0}if(!W(n))return!1;if(ty(n,!0)){const r=t.shiftKey;return t.preventDefault(),ny(n,r,!0),!0}return!1},be),e.registerCommand(uh,t=>{const n=Y();if(bt(n)){const o=n.getNodes();if(o.length>0)return t.preventDefault(),ey(o[0])?o[0].selectPrevious():o[0].selectNext(0,0),!0}if(!W(n))return!1;const r=t.shiftKey;return!!ty(n,!1)&&(t.preventDefault(),ny(n,r,!1),!0)},be),e.registerCommand(Ul,t=>{if(Sy(t.target))return!1;const n=Y();if(W(n)){if((function(r){if(!r.isCollapsed())return!1;const{anchor:o}=r;if(o.offset!==0)return!1;const i=o.getNode();if(ot(i))return!1;const s=YA(i);return s.getIndent()>0&&(s.is(i)||i.is(s.getFirstDescendant()))})(n))return t.preventDefault(),e.dispatchCommand(ym,void 0);if(xy&&navigator.language==="ko-KR")return!1}else if(!bt(n))return!1;return t.preventDefault(),e.dispatchCommand(Fr,!0)},be),e.registerCommand(ph,t=>{if(Sy(t.target))return!1;const n=Y();return!(!W(n)&&!bt(n))&&(t.preventDefault(),e.dispatchCommand(Fr,!1))},be),e.registerCommand(yl,t=>{const n=Y();if(!W(n))return!1;if(su(n),t!==null){if((xy||IM||jM)&&OM)return!1;if(t.preventDefault(),t.shiftKey)return e.dispatchCommand(gi,!1)}return e.dispatchCommand(_o,void 0)},be),e.registerCommand(gh,()=>{const t=Y();return!!W(t)&&(e.blur(),!0)},be),e.registerCommand(Y1,t=>{const[,n]=ka(t);if(n.length>0){const o=vy(t.clientX,t.clientY);if(o!==null){const{offset:i,node:s}=o,a=Ht(s);if(a!==null){const l=Zl();if(X(a))l.anchor.set(a.getKey(),i,"text"),l.focus.set(a.getKey(),i,"text");else{const u=a.getParentOrThrow().getKey(),f=a.getIndexWithinParent()+1;l.anchor.set(u,f,"element"),l.focus.set(u,f,"element")}const c=Ls(l);Ge(c)}e.dispatchCommand(by,n)}return t.preventDefault(),!0}const r=Y();return!!W(r)},be),e.registerCommand(X1,t=>{const[n]=ka(t),r=Y();return!(n&&!W(r))},be),e.registerCommand(Z1,t=>{const[n]=ka(t),r=Y();if(n&&!W(r))return!1;const o=vy(t.clientX,t.clientY);if(o!==null){const i=Ht(o.node);_e(i)&&t.preventDefault()}return!0},be),e.registerCommand(Md,()=>(xA(),!0),be),e.registerCommand(Gl,t=>(Zd(e,Ar(t,ClipboardEvent)?t:null),!0),be),e.registerCommand(ql,t=>((async function(n,r){await Zd(r,Ar(n,ClipboardEvent)?n:null),r.update(()=>{const o=Y();W(o)?o.removeText():bt(o)&&o.getNodes().forEach(i=>i.remove())})})(t,e),!0),be),e.registerCommand(ch,t=>{const[,n,r]=ka(t);return n.length>0&&!r?(e.dispatchCommand(by,n),!0):xn(t.target)&&Th(t.target)?!1:Y()!==null&&((function(o,i){o.preventDefault(),i.update(()=>{const s=Y(),a=Ar(o,InputEvent)||Ar(o,KeyboardEvent)?null:o.clipboardData;a!=null&&s!==null&&py(a,s,i)},{tag:Y3})})(t,e),!0)},be),e.registerCommand(q1,t=>{const n=Y();return W(n)&&su(n),!1},be),e.registerCommand(mh,t=>{const n=Y();return W(n)&&su(n),!1},be))}var au={exports:{}},_y;function zM(){return _y||(_y=1,(function(e){var t=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{};var n=(function(r){var o=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,i=0,s={},a={manual:r.Prism&&r.Prism.manual,disableWorkerMessageHandler:r.Prism&&r.Prism.disableWorkerMessageHandler,util:{encode:function y(v){return v instanceof l?new l(v.type,y(v.content),v.alias):Array.isArray(v)?v.map(y):v.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function(y){return Object.prototype.toString.call(y).slice(8,-1)},objId:function(y){return y.__id||Object.defineProperty(y,"__id",{value:++i}),y.__id},clone:function y(v,b){b=b||{};var w,_;switch(a.util.type(v)){case"Object":if(_=a.util.objId(v),b[_])return b[_];w={},b[_]=w;for(var E in v)v.hasOwnProperty(E)&&(w[E]=y(v[E],b));return w;case"Array":return _=a.util.objId(v),b[_]?b[_]:(w=[],b[_]=w,v.forEach(function(T,k){w[k]=y(T,b)}),w);default:return v}},getLanguage:function(y){for(;y;){var v=o.exec(y.className);if(v)return v[1].toLowerCase();y=y.parentElement}return"none"},setLanguage:function(y,v){y.className=y.className.replace(RegExp(o,"gi"),""),y.classList.add("language-"+v)},currentScript:function(){if(typeof document>"u")return null;if(document.currentScript&&document.currentScript.tagName==="SCRIPT")return document.currentScript;try{throw new Error}catch(w){var y=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(w.stack)||[])[1];if(y){var v=document.getElementsByTagName("script");for(var b in v)if(v[b].src==y)return v[b]}return null}},isActive:function(y,v,b){for(var w="no-"+v;y;){var _=y.classList;if(_.contains(v))return!0;if(_.contains(w))return!1;y=y.parentElement}return!!b}},languages:{plain:s,plaintext:s,text:s,txt:s,extend:function(y,v){var b=a.util.clone(a.languages[y]);for(var w in v)b[w]=v[w];return b},insertBefore:function(y,v,b,w){w=w||a.languages;var _=w[y],E={};for(var T in _)if(_.hasOwnProperty(T)){if(T==v)for(var k in b)b.hasOwnProperty(k)&&(E[k]=b[k]);b.hasOwnProperty(T)||(E[T]=_[T])}var P=w[y];return w[y]=E,a.languages.DFS(a.languages,function(O,D){D===P&&O!=y&&(this[O]=E)}),E},DFS:function y(v,b,w,_){_=_||{};var E=a.util.objId;for(var T in v)if(v.hasOwnProperty(T)){b.call(v,T,v[T],w||T);var k=v[T],P=a.util.type(k);P==="Object"&&!_[E(k)]?(_[E(k)]=!0,y(k,b,null,_)):P==="Array"&&!_[E(k)]&&(_[E(k)]=!0,y(k,b,T,_))}}},plugins:{},highlightAll:function(y,v){a.highlightAllUnder(document,y,v)},highlightAllUnder:function(y,v,b){var w={callback:b,container:y,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};a.hooks.run("before-highlightall",w),w.elements=Array.prototype.slice.apply(w.container.querySelectorAll(w.selector)),a.hooks.run("before-all-elements-highlight",w);for(var _=0,E;E=w.elements[_++];)a.highlightElement(E,v===!0,w.callback)},highlightElement:function(y,v,b){var w=a.util.getLanguage(y),_=a.languages[w];a.util.setLanguage(y,w);var E=y.parentElement;E&&E.nodeName.toLowerCase()==="pre"&&a.util.setLanguage(E,w);var T=y.textContent,k={element:y,language:w,grammar:_,code:T};function P(D){k.highlightedCode=D,a.hooks.run("before-insert",k),k.element.innerHTML=k.highlightedCode,a.hooks.run("after-highlight",k),a.hooks.run("complete",k),b&&b.call(k.element)}if(a.hooks.run("before-sanity-check",k),E=k.element.parentElement,E&&E.nodeName.toLowerCase()==="pre"&&!E.hasAttribute("tabindex")&&E.setAttribute("tabindex","0"),!k.code){a.hooks.run("complete",k),b&&b.call(k.element);return}if(a.hooks.run("before-highlight",k),!k.grammar){P(a.util.encode(k.code));return}if(v&&r.Worker){var O=new Worker(a.filename);O.onmessage=function(D){P(D.data)},O.postMessage(JSON.stringify({language:k.language,code:k.code,immediateClose:!0}))}else P(a.highlight(k.code,k.grammar,k.language))},highlight:function(y,v,b){var w={code:y,grammar:v,language:b};if(a.hooks.run("before-tokenize",w),!w.grammar)throw new Error('The language "'+w.language+'" has no grammar.');return w.tokens=a.tokenize(w.code,w.grammar),a.hooks.run("after-tokenize",w),l.stringify(a.util.encode(w.tokens),w.language)},tokenize:function(y,v){var b=v.rest;if(b){for(var w in b)v[w]=b[w];delete v.rest}var _=new f;return d(_,_.head,y),u(y,_,v,_.head,0),g(_)},hooks:{all:{},add:function(y,v){var b=a.hooks.all;b[y]=b[y]||[],b[y].push(v)},run:function(y,v){var b=a.hooks.all[y];if(!(!b||!b.length))for(var w=0,_;_=b[w++];)_(v)}},Token:l};r.Prism=a;function l(y,v,b,w){this.type=y,this.content=v,this.alias=b,this.length=(w||"").length|0}l.stringify=function y(v,b){if(typeof v=="string")return v;if(Array.isArray(v)){var w="";return v.forEach(function(P){w+=y(P,b)}),w}var _={type:v.type,content:y(v.content,b),tag:"span",classes:["token",v.type],attributes:{},language:b},E=v.alias;E&&(Array.isArray(E)?Array.prototype.push.apply(_.classes,E):_.classes.push(E)),a.hooks.run("wrap",_);var T="";for(var k in _.attributes)T+=" "+k+'="'+(_.attributes[k]||"").replace(/"/g,"&quot;")+'"';return"<"+_.tag+' class="'+_.classes.join(" ")+'"'+T+">"+_.content+"</"+_.tag+">"};function c(y,v,b,w){y.lastIndex=v;var _=y.exec(b);if(_&&w&&_[1]){var E=_[1].length;_.index+=E,_[0]=_[0].slice(E)}return _}function u(y,v,b,w,_,E){for(var T in b)if(!(!b.hasOwnProperty(T)||!b[T])){var k=b[T];k=Array.isArray(k)?k:[k];for(var P=0;P<k.length;++P){if(E&&E.cause==T+","+P)return;var O=k[P],D=O.inside,I=!!O.lookbehind,$=!!O.greedy,H=O.alias;if($&&!O.pattern.global){var U=O.pattern.toString().match(/[imsuy]*$/)[0];O.pattern=RegExp(O.pattern.source,U+"g")}for(var L=O.pattern||O,N=w.next,V=_;N!==v.tail&&!(E&&V>=E.reach);V+=N.value.length,N=N.next){var K=N.value;if(v.length>y.length)return;if(!(K instanceof l)){var te=1,J;if($){if(J=c(L,V,y,I),!J||J.index>=y.length)break;var fe=J.index,Z=J.index+J[0].length,ae=V;for(ae+=N.value.length;fe>=ae;)N=N.next,ae+=N.value.length;if(ae-=N.value.length,V=ae,N.value instanceof l)continue;for(var oe=N;oe!==v.tail&&(ae<Z||typeof oe.value=="string");oe=oe.next)te++,ae+=oe.value.length;te--,K=y.slice(V,ae),J.index-=V}else if(J=c(L,0,K,I),!J)continue;var fe=J.index,Te=J[0],ne=K.slice(0,fe),ve=K.slice(fe+Te.length),Ee=V+K.length;E&&Ee>E.reach&&(E.reach=Ee);var De=N.prev;ne&&(De=d(v,De,ne),V+=ne.length),h(v,De,te);var st=new l(T,D?a.tokenize(Te,D):Te,H,Te);if(N=d(v,De,st),ve&&d(v,N,ve),te>1){var ee={cause:T+","+P,reach:Ee};u(y,v,b,N.prev,V,ee),E&&ee.reach>E.reach&&(E.reach=ee.reach)}}}}}}function f(){var y={value:null,prev:null,next:null},v={value:null,prev:y,next:null};y.next=v,this.head=y,this.tail=v,this.length=0}function d(y,v,b){var w=v.next,_={value:b,prev:v,next:w};return v.next=_,w.prev=_,y.length++,_}function h(y,v,b){for(var w=v.next,_=0;_<b&&w!==y.tail;_++)w=w.next;v.next=w,w.prev=v,y.length-=_}function g(y){for(var v=[],b=y.head.next;b!==y.tail;)v.push(b.value),b=b.next;return v}if(!r.document)return r.addEventListener&&(a.disableWorkerMessageHandler||r.addEventListener("message",function(y){var v=JSON.parse(y.data),b=v.language,w=v.code,_=v.immediateClose;r.postMessage(a.highlight(w,a.languages[b],b)),_&&r.close()},!1)),a;var p=a.util.currentScript();p&&(a.filename=p.src,p.hasAttribute("data-manual")&&(a.manual=!0));function m(){a.manual||a.highlightAll()}if(!a.manual){var x=document.readyState;x==="loading"||x==="interactive"&&p&&p.defer?document.addEventListener("DOMContentLoaded",m):window.requestAnimationFrame?window.requestAnimationFrame(m):window.setTimeout(m,16)}return a})(t);e.exports&&(e.exports=n),typeof Dn<"u"&&(Dn.Prism=n),n.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},n.languages.markup.tag.inside["attr-value"].inside.entity=n.languages.markup.entity,n.languages.markup.doctype.inside["internal-subset"].inside=n.languages.markup,n.hooks.add("wrap",function(r){r.type==="entity"&&(r.attributes.title=r.content.replace(/&amp;/,"&"))}),Object.defineProperty(n.languages.markup.tag,"addInlined",{value:function(o,i){var s={};s["language-"+i]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:n.languages[i]},s.cdata=/^<!\[CDATA\[|\]\]>$/i;var a={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:s}};a["language-"+i]={pattern:/[\s\S]+/,inside:n.languages[i]};var l={};l[o]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return o}),"i"),lookbehind:!0,greedy:!0,inside:a},n.languages.insertBefore("markup","cdata",l)}}),Object.defineProperty(n.languages.markup.tag,"addAttribute",{value:function(r,o){n.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+r+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[o,"language-"+o],inside:n.languages[o]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),n.languages.html=n.languages.markup,n.languages.mathml=n.languages.markup,n.languages.svg=n.languages.markup,n.languages.xml=n.languages.extend("markup",{}),n.languages.ssml=n.languages.xml,n.languages.atom=n.languages.xml,n.languages.rss=n.languages.xml,(function(r){var o=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;r.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+o.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+o.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+o.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+o.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:o,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},r.languages.css.atrule.inside.rest=r.languages.css;var i=r.languages.markup;i&&(i.tag.addInlined("style","css"),i.tag.addAttribute("style","css"))})(n),n.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},n.languages.javascript=n.languages.extend("clike",{"class-name":[n.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),n.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,n.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:n.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:n.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:n.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:n.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:n.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),n.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:n.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),n.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),n.languages.markup&&(n.languages.markup.tag.addInlined("script","javascript"),n.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),n.languages.js=n.languages.javascript,(function(){if(typeof n>"u"||typeof document>"u")return;Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var r="Loading…",o=function(p,m){return"✖ Error "+p+" while fetching file: "+m},i="✖ Error: File does not exist or is empty",s={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},a="data-src-status",l="loading",c="loaded",u="failed",f="pre[data-src]:not(["+a+'="'+c+'"]):not(['+a+'="'+l+'"])';function d(p,m,x){var y=new XMLHttpRequest;y.open("GET",p,!0),y.onreadystatechange=function(){y.readyState==4&&(y.status<400&&y.responseText?m(y.responseText):y.status>=400?x(o(y.status,y.statusText)):x(i))},y.send(null)}function h(p){var m=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(p||"");if(m){var x=Number(m[1]),y=m[2],v=m[3];return y?v?[x,Number(v)]:[x,void 0]:[x,x]}}n.hooks.add("before-highlightall",function(p){p.selector+=", "+f}),n.hooks.add("before-sanity-check",function(p){var m=p.element;if(m.matches(f)){p.code="",m.setAttribute(a,l);var x=m.appendChild(document.createElement("CODE"));x.textContent=r;var y=m.getAttribute("data-src"),v=p.language;if(v==="none"){var b=(/\.(\w+)$/.exec(y)||[,"none"])[1];v=s[b]||b}n.util.setLanguage(x,v),n.util.setLanguage(m,v);var w=n.plugins.autoloader;w&&w.loadLanguages(v),d(y,function(_){m.setAttribute(a,c);var E=h(m.getAttribute("data-range"));if(E){var T=_.split(/\r\n?|\n/g),k=E[0],P=E[1]==null?T.length:E[1];k<0&&(k+=T.length),k=Math.max(0,Math.min(k-1,T.length)),P<0&&(P+=T.length),P=Math.max(0,Math.min(P,T.length)),_=T.slice(k,P).join(`
48
- `),m.hasAttribute("data-start")||m.setAttribute("data-start",String(k+1))}x.textContent=_,n.highlightElement(x)},function(_){m.setAttribute(a,u),x.textContent=_})}}),n.plugins.fileHighlight={highlight:function(m){for(var x=(m||document).querySelectorAll(f),y=0,v;v=x[y++];)n.highlightElement(v)}};var g=!1;n.fileHighlight=function(){g||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),g=!0),n.plugins.fileHighlight.highlight.apply(this,arguments)}})()})(au)),au.exports}zM();Prism.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/};Prism.languages.javascript=Prism.languages.extend("clike",{"class-name":[Prism.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/});Prism.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/;Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:Prism.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:Prism.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/});Prism.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:Prism.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}});Prism.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}});Prism.languages.markup&&(Prism.languages.markup.tag.addInlined("script","javascript"),Prism.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript"));Prism.languages.js=Prism.languages.javascript;Prism.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]};Prism.languages.markup.tag.inside["attr-value"].inside.entity=Prism.languages.markup.entity;Prism.languages.markup.doctype.inside["internal-subset"].inside=Prism.languages.markup;Prism.hooks.add("wrap",function(e){e.type==="entity"&&(e.attributes.title=e.content.replace(/&amp;/,"&"))});Object.defineProperty(Prism.languages.markup.tag,"addInlined",{value:function(t,n){var r={};r["language-"+n]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:Prism.languages[n]},r.cdata=/^<!\[CDATA\[|\]\]>$/i;var o={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:r}};o["language-"+n]={pattern:/[\s\S]+/,inside:Prism.languages[n]};var i={};i[t]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return t}),"i"),lookbehind:!0,greedy:!0,inside:o},Prism.languages.insertBefore("markup","cdata",i)}});Object.defineProperty(Prism.languages.markup.tag,"addAttribute",{value:function(e,t){Prism.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+e+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,"language-"+t],inside:Prism.languages[t]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}});Prism.languages.html=Prism.languages.markup;Prism.languages.mathml=Prism.languages.markup;Prism.languages.svg=Prism.languages.markup;Prism.languages.xml=Prism.languages.extend("markup",{});Prism.languages.ssml=Prism.languages.xml;Prism.languages.atom=Prism.languages.xml;Prism.languages.rss=Prism.languages.xml;(function(e){var t=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function n(u){return u=u.replace(/<inner>/g,function(){return t}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+u+")")}var r=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,o=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return r}),i=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source;e.languages.markdown=e.languages.extend("markup",{}),e.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:e.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+o+i+"(?:"+o+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+o+i+")(?:"+o+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(r),inside:e.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+o+")"+i+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+o+"$"),inside:{"table-header":{pattern:RegExp(r),alias:"important",inside:e.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:n(/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:n(/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:n(/(~~?)(?:(?!~)<inner>)+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:n(/!?\[(?:(?!\])<inner>)+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\])<inner>)+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach(function(u){["url","bold","italic","strike","code-snippet"].forEach(function(f){u!==f&&(e.languages.markdown[u].inside.content.inside[f]=e.languages.markdown[f])})}),e.hooks.add("after-tokenize",function(u){if(u.language!=="markdown"&&u.language!=="md")return;function f(d){if(!(!d||typeof d=="string"))for(var h=0,g=d.length;h<g;h++){var p=d[h];if(p.type!=="code"){f(p.content);continue}var m=p.content[1],x=p.content[3];if(m&&x&&m.type==="code-language"&&x.type==="code-block"&&typeof m.content=="string"){var y=m.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp");y=(/[a-z][\w-]*/i.exec(y)||[""])[0].toLowerCase();var v="language-"+y;x.alias?typeof x.alias=="string"?x.alias=[x.alias,v]:x.alias.push(v):x.alias=[v]}}}f(u.tokens)}),e.hooks.add("wrap",function(u){if(u.type==="code-block"){for(var f="",d=0,h=u.classes.length;d<h;d++){var g=u.classes[d],p=/language-(.+)/.exec(g);if(p){f=p[1];break}}var m=e.languages[f];if(m)u.content=e.highlight(c(u.content),m,f);else if(f&&f!=="none"&&e.plugins.autoloader){var x="md-"+new Date().valueOf()+"-"+Math.floor(Math.random()*1e16);u.attributes.id=x,e.plugins.autoloader.loadLanguages(f,function(){var y=document.getElementById(x);y&&(y.innerHTML=e.highlight(y.textContent,e.languages[f],f))})}}});var s=RegExp(e.languages.markup.tag.pattern.source,"gi"),a={amp:"&",lt:"<",gt:">",quot:'"'},l=String.fromCodePoint||String.fromCharCode;function c(u){var f=u.replace(s,"");return f=f.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,function(d,h){if(h=h.toLowerCase(),h[0]==="#"){var g;return h[1]==="x"?g=parseInt(h.slice(2),16):g=Number(h.slice(1)),l(g)}else{var p=a[h];return p||d}}),f}e.languages.md=e.languages.markdown})(Prism);Prism.languages.c=Prism.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/});Prism.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}});Prism.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},Prism.languages.c.string],char:Prism.languages.c.char,comment:Prism.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:Prism.languages.c}}}});Prism.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/});delete Prism.languages.c.boolean;(function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+t.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var n=e.languages.markup;n&&(n.tag.addInlined("style","css"),n.tag.addAttribute("style","css"))})(Prism);Prism.languages.objectivec=Prism.languages.extend("c",{string:{pattern:/@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},keyword:/\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|\|?|[~^%?*\/@]/});delete Prism.languages.objectivec["class-name"];Prism.languages.objc=Prism.languages.objectivec;Prism.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/};(function(e){var t=e.languages.powershell={comment:[{pattern:/(^|[^`])<#[\s\S]*?#>/,lookbehind:!0},{pattern:/(^|[^`])#.*/,lookbehind:!0}],string:[{pattern:/"(?:`[\s\S]|[^`"])*"/,greedy:!0,inside:null},{pattern:/'(?:[^']|'')*'/,greedy:!0}],namespace:/\[[a-z](?:\[(?:\[[^\]]*\]|[^\[\]])*\]|[^\[\]])*\]/i,boolean:/\$(?:false|true)\b/i,variable:/\$\w+\b/,function:[/\b(?:Add|Approve|Assert|Backup|Block|Checkpoint|Clear|Close|Compare|Complete|Compress|Confirm|Connect|Convert|ConvertFrom|ConvertTo|Copy|Debug|Deny|Disable|Disconnect|Dismount|Edit|Enable|Enter|Exit|Expand|Export|Find|ForEach|Format|Get|Grant|Group|Hide|Import|Initialize|Install|Invoke|Join|Limit|Lock|Measure|Merge|Move|New|Open|Optimize|Out|Ping|Pop|Protect|Publish|Push|Read|Receive|Redo|Register|Remove|Rename|Repair|Request|Reset|Resize|Resolve|Restart|Restore|Resume|Revoke|Save|Search|Select|Send|Set|Show|Skip|Sort|Split|Start|Step|Stop|Submit|Suspend|Switch|Sync|Tee|Test|Trace|Unblock|Undo|Uninstall|Unlock|Unprotect|Unpublish|Unregister|Update|Use|Wait|Watch|Where|Write)-[a-z]+\b/i,/\b(?:ac|cat|chdir|clc|cli|clp|clv|compare|copy|cp|cpi|cpp|cvpa|dbp|del|diff|dir|ebp|echo|epal|epcsv|epsn|erase|fc|fl|ft|fw|gal|gbp|gc|gci|gcs|gdr|gi|gl|gm|gp|gps|group|gsv|gu|gv|gwmi|iex|ii|ipal|ipcsv|ipsn|irm|iwmi|iwr|kill|lp|ls|measure|mi|mount|move|mp|mv|nal|ndr|ni|nv|ogv|popd|ps|pushd|pwd|rbp|rd|rdr|ren|ri|rm|rmdir|rni|rnp|rp|rv|rvpa|rwmi|sal|saps|sasv|sbp|sc|select|set|shcm|si|sl|sleep|sls|sort|sp|spps|spsv|start|sv|swmi|tee|trcm|type|write)\b/i],keyword:/\b(?:Begin|Break|Catch|Class|Continue|Data|Define|Do|DynamicParam|Else|ElseIf|End|Exit|Filter|Finally|For|ForEach|From|Function|If|InlineScript|Parallel|Param|Process|Return|Sequence|Switch|Throw|Trap|Try|Until|Using|Var|While|Workflow)\b/i,operator:{pattern:/(^|\W)(?:!|-(?:b?(?:and|x?or)|as|(?:Not)?(?:Contains|In|Like|Match)|eq|ge|gt|is(?:Not)?|Join|le|lt|ne|not|Replace|sh[lr])\b|-[-=]?|\+[+=]?|[*\/%]=?)/i,lookbehind:!0},punctuation:/[|{}[\];(),.]/};t.string[0].inside={function:{pattern:/(^|[^`])\$\((?:\$\([^\r\n()]*\)|(?!\$\()[^\r\n)])*\)/,lookbehind:!0,inside:t},boolean:t.boolean,variable:t.variable}})(Prism);var Ty={},Ey;function HM(){return Ey||(Ey=1,Prism.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},Prism.languages.python["string-interpolation"].inside.interpolation.inside.rest=Prism.languages.python,Prism.languages.py=Prism.languages.python),Ty}HM();var Ry={},ky;function WM(){return ky||(ky=1,(function(e){for(var t=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source,n=0;n<2;n++)t=t.replace(/<self>/g,function(){return t});t=t.replace(/<self>/g,function(){return/[^\s\S]/.source}),e.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+t),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:"attr-name",inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:"punctuation"},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:"symbol"},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:"punctuation"},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:"function"},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:"class-name"},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:"namespace"},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:"namespace",inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:"property"},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},e.languages.rust["closure-params"].inside.rest=e.languages.rust,e.languages.rust.attribute.inside.string=e.languages.rust.string})(Prism)),Ry}WM();Prism.languages.swift={comment:{pattern:/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,lookbehind:!0,greedy:!0},"string-literal":[{pattern:RegExp(/(^|[^"#])/.source+"(?:"+/"(?:\\(?:\((?:[^()]|\([^()]*\))*\)|\r\n|[^(])|[^\\\r\n"])*"/.source+"|"+/"""(?:\\(?:\((?:[^()]|\([^()]*\))*\)|[^(])|[^\\"]|"(?!""))*"""/.source+")"+/(?!["#])/.source),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:"punctuation"},punctuation:/\\(?=[\r\n])/,string:/[\s\S]+/}},{pattern:RegExp(/(^|[^"#])(#+)/.source+"(?:"+/"(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|\r\n|[^#])|[^\\\r\n])*?"/.source+"|"+/"""(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|[^#])|[^\\])*?"""/.source+")\\2"),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:"punctuation"},string:/[\s\S]+/}}],directive:{pattern:RegExp(/#/.source+"(?:"+(/(?:elseif|if)\b/.source+"(?:[ ]*"+/(?:![ \t]*)?(?:\b\w+\b(?:[ \t]*\((?:[^()]|\([^()]*\))*\))?|\((?:[^()]|\([^()]*\))*\))(?:[ \t]*(?:&&|\|\|))?/.source+")+")+"|"+/(?:else|endif)\b/.source+")"),alias:"property",inside:{"directive-name":/^#\w+/,boolean:/\b(?:false|true)\b/,number:/\b\d+(?:\.\d+)*\b/,operator:/!|&&|\|\||[<>]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:"constant"},"other-directive":{pattern:/#\w+\b/,alias:"property"},attribute:{pattern:/@\w+/,alias:"atrule"},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:"function"},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:"important"},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:"constant"},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:"keyword"},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/};Prism.languages.swift["string-literal"].forEach(function(e){e.inside.interpolation.inside=Prism.languages.swift});var Ay={},My;function KM(){return My||(My=1,(function(e){e.languages.typescript=e.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),e.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete e.languages.typescript.parameter,delete e.languages.typescript["literal-property"];var t=e.languages.extend("typescript",{});delete t["class-name"],e.languages.typescript["class-name"].inside=t,e.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:t}}}}),e.languages.ts=e.languages.typescript})(Prism)),Ay}KM();var Ny={},Py;function UM(){return Py||(Py=1,(function(e){var t=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,n=/(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,r={pattern:RegExp(/(^|[^\w.])/.source+n+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};e.languages.java=e.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[r,{pattern:RegExp(/(^|[^\w.])/.source+n+/[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),lookbehind:!0,inside:r.inside},{pattern:RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source+n+/[A-Z]\w*\b/.source),lookbehind:!0,inside:r.inside}],keyword:t,function:[e.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0},constant:/\b[A-Z][A-Z_\d]+\b/}),e.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),e.languages.insertBefore("java","class-name",{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:"punctuation"},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":r,keyword:t,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(/(\bimport\s+)/.source+n+/(?:[A-Z]\w*|\*)(?=\s*;)/.source),lookbehind:!0,inside:{namespace:r.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(/(\bimport\s+static\s+)/.source+n+/(?:\w+|\*)(?=\s*;)/.source),lookbehind:!0,alias:"static",inside:{namespace:r.inside.namespace,static:/\b\w+$/,punctuation:/\./,operator:/\*/,"class-name":/\w+/}}],namespace:{pattern:RegExp(/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!<keyword>)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(/<keyword>/g,function(){return t.source})),lookbehind:!0,inside:{punctuation:/\./}}})})(Prism)),Ny}UM();var Ly={},Fy;function GM(){return Fy||(Fy=1,(function(e){var t=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,n=/\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g,function(){return t.source});e.languages.cpp=e.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g,function(){return t.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:t,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),e.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/<mod-name>(?:\s*:\s*<mod-name>)?|:\s*<mod-name>/.source.replace(/<mod-name>/g,function(){return n})+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),e.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:e.languages.cpp}}}}),e.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),e.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:e.languages.extend("cpp",{})}}),e.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},e.languages.cpp["base-clause"])})(Prism)),Ly}GM();function kw(e,t){for(const n of e.childNodes){if(Be(n)&&n.tagName===t)return!0;kw(n,t)}return!1}const ps="data-language",rs="data-highlight-language",Aa="data-theme";let sc=class Aw extends St{__language;__theme;__isSyntaxHighlightSupported;static getType(){return"code"}static clone(t){return new Aw(t.__language,t.__key)}constructor(t,n){super(n),this.__language=t||void 0,this.__isSyntaxHighlightSupported=!1,this.__theme=void 0}afterCloneFrom(t){super.afterCloneFrom(t),this.__language=t.__language,this.__theme=t.__theme,this.__isSyntaxHighlightSupported=t.__isSyntaxHighlightSupported}createDOM(t){const n=document.createElement("code");Qe(n,t.theme.code),n.setAttribute("spellcheck","false");const r=this.getLanguage();r&&(n.setAttribute(ps,r),this.getIsSyntaxHighlightSupported()&&n.setAttribute(rs,r));const o=this.getTheme();o&&n.setAttribute(Aa,o);const i=this.getStyle();return i&&n.setAttribute("style",i),n}updateDOM(t,n,r){const o=this.__language,i=t.__language;o?o!==i&&n.setAttribute(ps,o):i&&n.removeAttribute(ps);const s=this.__isSyntaxHighlightSupported;t.__isSyntaxHighlightSupported&&i?s&&o?o!==i&&n.setAttribute(rs,o):n.removeAttribute(rs):s&&o&&n.setAttribute(rs,o);const a=this.__theme,l=t.__theme;a?a!==l&&n.setAttribute(Aa,a):l&&n.removeAttribute(Aa);const c=this.__style,u=t.__style;return c?c!==u&&n.setAttribute("style",c):u&&n.removeAttribute("style"),!1}exportDOM(t){const n=document.createElement("pre");Qe(n,t._config.theme.code),n.setAttribute("spellcheck","false");const r=this.getLanguage();r&&(n.setAttribute(ps,r),this.getIsSyntaxHighlightSupported()&&n.setAttribute(rs,r));const o=this.getTheme();o&&n.setAttribute(Aa,o);const i=this.getStyle();return i&&n.setAttribute("style",i),{element:n}}static importDOM(){return{code:t=>t.textContent!=null&&(/\r?\n/.test(t.textContent)||kw(t,"BR"))?{conversion:$y,priority:1}:null,div:()=>({conversion:qM,priority:1}),pre:()=>({conversion:$y,priority:0}),table:t=>lu(t)?{conversion:YM,priority:3}:null,td:t=>{const n=t,r=n.closest("table");return n.classList.contains("js-file-line")||r&&lu(r)?{conversion:Oy,priority:3}:null},tr:t=>{const n=t.closest("table");return n&&lu(n)?{conversion:Oy,priority:3}:null}}}static importJSON(t){return ur().updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setLanguage(t.language).setTheme(t.theme)}exportJSON(){return{...super.exportJSON(),language:this.getLanguage(),theme:this.getTheme()}}insertNewAfter(t,n=!0){const r=this.getChildren(),o=r.length;if(o>=2&&r[o-1].getTextContent()===`
47
+ `?c.insertParagraph():u===" "?c.insertNodes([qi()]):c.insertText(u)}}}else t.insertRawText(s)}function xy(e,t,n){e.dispatchCommand(mh,{nodes:t,selection:n})||(n.insertNodes(t),(function(r){if(W(r)&&r.isCollapsed()){const o=r.anchor;let i=null;const s=An(o,"previous");if(s)if(Gn(s))i=s.origin;else{const a=Kr(s,Ft(qe(),"next").getFlipped());for(const l of a){if(J(l.origin)){i=l.origin;break}if(B(l.origin)&&!l.origin.isInline())break}}if(i&&J(i)){const a=i.getFormat(),l=i.getStyle();r.format===a&&r.style===l||(r.format=a,r.style=l,r.dirty=!0)}}})(n))}function Rw(e,t,n,r=[]){let o=t===null||n.isSelected(t);const i=B(n)&&n.excludeFromCopy("html");let s=n;t!==null&&J(s)&&(s=J1(t,s,"clone"));const a=B(s)?s.getChildren():[],l=(function(c){const u=c.exportJSON(),f=c.constructor;if(u.type!==f.getType()&&$l(58,f.name),B(c)){const d=u.children;Array.isArray(d)||$l(59,f.name)}return u})(s);J(s)&&s.getTextContentSize()===0&&(o=!1);for(let c=0;c<a.length;c++){const u=a[c],f=Rw(e,t,u,l.children);!o&&B(n)&&f&&n.extractWithChild(u,t,"clone")&&(o=!0)}if(o&&!i)r.push(l);else if(Array.isArray(l.children))for(let c=0;c<l.children.length;c++){const u=l.children[c];r.push(u)}return o}function LN(e,t){const n=[],r=qe().getChildren();for(let o=0;o<r.length;o++)Rw(e,t,r[o],n);return{namespace:e._config.namespace,nodes:n}}function FN(e){const t=[];for(let n=0;n<e.length;n++){const r=e[n],o=gA(r);J(o)&&GA(o),t.push(o)}return t}let ei=null;async function af(e,t,n){if(ei!==null)return!1;if(t!==null)return new Promise((c,u)=>{e.update(()=>{c(by(e,t,n))})});const r=e.getRootElement(),o=e._window||window,i=o.document,s=Ot(o);if(r===null||s===null)return!1;const a=i.createElement("span");a.style.cssText="position: fixed; top: -1000px;",a.append(i.createTextNode("#")),r.append(a);const l=new Range;return l.setStart(a,0),l.setEnd(a,1),s.removeAllRanges(),s.addRange(l),new Promise((c,u)=>{const f=e.registerCommand(tc,d=>(Pr(d,ClipboardEvent)&&(f(),ei!==null&&(o.clearTimeout(ei),ei=null),c(by(e,d,n))),!0),yA);ei=o.setTimeout(()=>{f(),ei=null,c(!1)},50),i.execCommand("copy"),a.remove()})}function by(e,t,n){if(n===void 0){const o=Ot(e._window),i=X();if(!i||i.isCollapsed()||!o)return!1;const s=o.anchorNode,a=o.focusNode;if(s!==null&&a!==null&&!aa(e,s,a))return!1;n=Aw(i)}t.preventDefault();const r=t.clipboardData;return r!==null&&($N(r,n),!0)}const kw=[["text/html",MN],["application/x-lexical-editor",PN]];function Aw(e=X()){const t={"text/plain":e?e.getTextContent():""};if(e){const n=Zi();for(const[r,o]of kw){const i=o(n,e);i!==null&&(t[r]=i)}}return t}function $N(e,t){for(const[n]of kw)t[n]===void 0&&e.setData(n,"");for(const n in t){const r=t[n];r!==void 0&&e.setData(n,r)}}function ON(e){const t=window.location.origin,n=r=>{if(r.origin!==t)return;const o=e.getRootElement();if(document.activeElement!==o)return;const i=r.data;if(typeof i=="string"){let s;try{s=JSON.parse(i)}catch{return}if(s&&s.protocol==="nuanria_messaging"&&s.type==="request"){const a=s.payload;if(a&&a.functionId==="makeChanges"){const l=a.args;if(l){const[c,u,f,d,h]=l;e.update(()=>{const g=X();if(W(g)){const p=g.anchor;let m=p.getNode(),v=0,y=0;if(J(m)&&c>=0&&u>=0&&(v=c,y=c+u,g.setTextNodeRange(m,v,m,y)),v===y&&f===""||(g.insertRawText(f),m=p.getNode()),J(m)){v=d,y=d+h;const x=m.getTextContentSize();v=v>x?x:v,y=y>x?x:y,g.setTextNodeRange(m,v,m,y)}r.stopImmediatePropagation()}})}}}}};return window.addEventListener("message",n,!0),()=>{window.removeEventListener("message",n,!0)}}function wy(e,t){if(document.caretRangeFromPoint!==void 0){const n=document.caretRangeFromPoint(e,t);return n===null?null:{node:n.startContainer,offset:n.startOffset}}if(document.caretPositionFromPoint!=="undefined"){const n=document.caretPositionFromPoint(e,t);return n===null?null:{node:n.offsetNode,offset:n.offset}}return null}const Go=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,IN=Go&&"documentMode"in document?document.documentMode:null,DN=Go&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),jN=!(!Go||!("InputEvent"in window)||IN)&&"getTargetRanges"in new window.InputEvent("input"),VN=Go&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),Cy=Go&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,BN=Go&&/^(?=.*Chrome).*/i.test(navigator.userAgent),zN=Go&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&DN&&!BN,Sy=ce("DRAG_DROP_PASTE_FILE");let fc=class Nw extends Tt{static getType(){return"quote"}static clone(t){return new Nw(t.__key)}createDOM(t){const n=document.createElement("blockquote");return et(n,t.theme.quote),n}updateDOM(t,n){return!1}static importDOM(){return{blockquote:t=>({conversion:HN,priority:0})}}exportDOM(t){const{element:n}=super.exportDOM(t);if(Be(n)){this.isEmpty()&&n.append(document.createElement("br"));const r=this.getFormatType();r&&(n.style.textAlign=r);const o=this.getDirection();o&&(n.dir=o)}return{element:n}}static importJSON(t){return Zh().updateFromJSON(t)}insertNewAfter(t,n){const r=ve(),o=this.getDirection();return r.setDirection(o),this.insertAfter(r,n),r}collapseAtStart(){const t=ve();return this.getChildren().forEach(n=>t.append(n)),this.replace(t),!0}canMergeWhenEmpty(){return!0}};function Zh(){return Et(new fc)}function lf(e){return e instanceof fc}let hc=class Mw extends Tt{__tag;static getType(){return"heading"}static clone(t){return new Mw(t.__tag,t.__key)}constructor(t,n){super(n),this.__tag=t}getTag(){return this.__tag}setTag(t){const n=this.getWritable();return this.__tag=t,n}createDOM(t){const n=this.__tag,r=document.createElement(n),o=t.theme.heading;if(o!==void 0){const i=o[n];et(r,i)}return r}updateDOM(t,n,r){return t.__tag!==this.__tag}static importDOM(){return{h1:t=>({conversion:ti,priority:0}),h2:t=>({conversion:ti,priority:0}),h3:t=>({conversion:ti,priority:0}),h4:t=>({conversion:ti,priority:0}),h5:t=>({conversion:ti,priority:0}),h6:t=>({conversion:ti,priority:0}),p:t=>{const n=t.firstChild;return n!==null&&_y(n)?{conversion:()=>({node:null}),priority:3}:null},span:t=>_y(t)?{conversion:n=>({node:wo("h1")}),priority:3}:null}}exportDOM(t){const{element:n}=super.exportDOM(t);if(Be(n)){this.isEmpty()&&n.append(document.createElement("br"));const r=this.getFormatType();r&&(n.style.textAlign=r);const o=this.getDirection();o&&(n.dir=o)}return{element:n}}static importJSON(t){return wo(t.tag).updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setTag(t.tag)}exportJSON(){return{...super.exportJSON(),tag:this.getTag()}}insertNewAfter(t,n=!0){const r=t?t.anchor.offset:0,o=this.getLastDescendant(),i=!o||t&&t.anchor.key===o.getKey()&&r===o.getTextContentSize()||!t?ve():wo(this.getTag()),s=this.getDirection();if(i.setDirection(s),this.insertAfter(i,n),r===0&&!this.isEmpty()&&t){const a=ve();a.select(),this.replace(a,!0)}return i}collapseAtStart(){const t=this.isEmpty()?ve():wo(this.getTag());return this.getChildren().forEach(n=>t.append(n)),this.replace(t),!0}extractWithChild(){return!0}};function _y(e){return e.nodeName.toLowerCase()==="span"&&e.style.fontSize==="26pt"}function ti(e){const t=e.nodeName.toLowerCase();let n=null;return t!=="h1"&&t!=="h2"&&t!=="h3"&&t!=="h4"&&t!=="h5"&&t!=="h6"||(n=wo(t),e.style!==null&&(Vh(e,n),n.setFormat(e.style.textAlign))),{node:n}}function HN(e){const t=Zh();return e.style!==null&&(t.setFormat(e.style.textAlign),Vh(e,t)),{node:t}}function wo(e="h1"){return Et(new hc(e))}function Pw(e){return e instanceof hc}function Oa(e){let t=null;if(Pr(e,DragEvent)?t=e.dataTransfer:Pr(e,ClipboardEvent)&&(t=e.clipboardData),t===null)return[!1,[],!1];const n=t.types,r=n.includes("Files"),o=n.includes("text/html")||n.includes("text/plain");return[r,Array.from(t.files),o]}function Ty(e){const t=X();if(!W(t))return!1;const n=new Set,r=t.getNodes();for(let o=0;o<r.length;o++){const i=r[o],s=i.getKey();if(n.has(s))continue;const a=we(i,c=>B(c)&&!c.isInline());if(a===null)continue;const l=a.getKey();a.canIndent()&&!n.has(l)&&(n.add(l),e(a))}return n.size>0}function Ey(e){const t=Ut(e);return Te(t)}function gu(e){for(const t of["lowercase","uppercase","capitalize"])e.hasFormat(t)&&e.toggleFormat(t)}function WN(e){return Nn(e.registerCommand(Ql,t=>{const n=X();return!!Ct(n)&&(n.clear(),!0)},be),e.registerCommand(Ir,t=>{const n=X();return W(n)?(n.deleteCharacter(t),!0):!!Ct(n)&&(n.deleteNodes(),!0)},be),e.registerCommand($i,t=>{const n=X();return!!W(n)&&(n.deleteWord(t),!0)},be),e.registerCommand(Po,t=>{const n=X();return!!W(n)&&(n.deleteLine(t),!0)},be),e.registerCommand(To,t=>{const n=X();if(typeof t=="string")n!==null&&n.insertText(t);else{if(n===null)return!1;const r=t.dataTransfer;if(r!=null)vy(r,n,e);else if(W(n)){const o=t.data;return o&&n.insertText(o),!0}}return!0},be),e.registerCommand(Dd,()=>{const t=X();return!!W(t)&&(t.removeText(),!0)},be),e.registerCommand(Vt,t=>{const n=X();return!!W(n)&&(n.formatText(t),!0)},be),e.registerCommand(_i,t=>{const n=X();if(!W(n)&&!Ct(n))return!1;const r=n.getNodes();for(const o of r){const i=we(o,s=>B(s)&&!s.isInline());i!==null&&i.setFormat(t)}return!0},be),e.registerCommand(Si,t=>{const n=X();return!!W(n)&&(n.insertLineBreak(t),!0)},be),e.registerCommand(Mo,()=>{const t=X();return!!W(t)&&(t.insertParagraph(),!0)},be),e.registerCommand(V3,()=>(Rh([qi()]),!0),be),e.registerCommand(B3,()=>Ty(t=>{const n=t.getIndent();t.setIndent(n+1)}),be),e.registerCommand(bm,()=>Ty(t=>{const n=t.getIndent();n>0&&t.setIndent(Math.max(0,n-1))}),be),e.registerCommand(bh,t=>{const n=X();if(Ct(n)){const r=n.getNodes();if(r.length>0)return t.preventDefault(),r[0].selectPrevious(),!0}else if(W(n)){const r=Xd(n.focus,!0);if(!t.shiftKey&&Te(r)&&!r.isIsolated()&&!r.isInline())return r.selectPrevious(),t.preventDefault(),!0}return!1},be),e.registerCommand(wh,t=>{const n=X();if(Ct(n)){const r=n.getNodes();if(r.length>0)return t.preventDefault(),r[0].selectNext(0,0),!0}else if(W(n)){if((function(o){const i=o.focus;return i.key==="root"&&i.offset===qe().getChildrenSize()})(n))return t.preventDefault(),!0;const r=Xd(n.focus,!1);if(!t.shiftKey&&Te(r)&&!r.isIsolated()&&!r.isInline())return r.selectNext(),t.preventDefault(),!0}return!1},be),e.registerCommand(xh,t=>{const n=X();if(Ct(n)){const r=n.getNodes();if(r.length>0)return t.preventDefault(),ry(r[0])?r[0].selectNext(0,0):r[0].selectPrevious(),!0}if(!W(n))return!1;if(oy(n,!0)){const r=t.shiftKey;return t.preventDefault(),iy(n,r,!0),!0}return!1},be),e.registerCommand(vh,t=>{const n=X();if(Ct(n)){const o=n.getNodes();if(o.length>0)return t.preventDefault(),ry(o[0])?o[0].selectPrevious():o[0].selectNext(0,0),!0}if(!W(n))return!1;const r=t.shiftKey;return!!oy(n,!1)&&(t.preventDefault(),iy(n,r,!1),!0)},be),e.registerCommand(ec,t=>{if(Ey(t.target))return!1;const n=X();if(W(n)){if((function(r){if(!r.isCollapsed())return!1;const{anchor:o}=r;if(o.offset!==0)return!1;const i=o.getNode();if(at(i))return!1;const s=JA(i);return s.getIndent()>0&&(s.is(i)||i.is(s.getFirstDescendant()))})(n))return t.preventDefault(),e.dispatchCommand(bm,void 0);if(Cy&&navigator.language==="ko-KR")return!1}else if(!Ct(n))return!1;return t.preventDefault(),e.dispatchCommand(Ir,!0)},be),e.registerCommand(Sh,t=>{if(Ey(t.target))return!1;const n=X();return!(!W(n)&&!Ct(n))&&(t.preventDefault(),e.dispatchCommand(Ir,!1))},be),e.registerCommand(Tl,t=>{const n=X();if(!W(n))return!1;if(gu(n),t!==null){if((Cy||VN||zN)&&jN)return!1;if(t.preventDefault(),t.shiftKey)return e.dispatchCommand(Si,!1)}return e.dispatchCommand(Mo,void 0)},be),e.registerCommand(Ch,()=>{const t=X();return!!W(t)&&(e.blur(),!0)},be),e.registerCommand(e1,t=>{const[,n]=Oa(t);if(n.length>0){const o=wy(t.clientX,t.clientY);if(o!==null){const{offset:i,node:s}=o,a=Ut(s);if(a!==null){const l=ic();if(J(a))l.anchor.set(a.getKey(),i,"text"),l.focus.set(a.getKey(),i,"text");else{const u=a.getParentOrThrow().getKey(),f=a.getIndexWithinParent()+1;l.anchor.set(u,f,"element"),l.focus.set(u,f,"element")}const c=Bs(l);Ge(c)}e.dispatchCommand(Sy,n)}return t.preventDefault(),!0}const r=X();return!!W(r)},be),e.registerCommand(t1,t=>{const[n]=Oa(t),r=X();return!(n&&!W(r))},be),e.registerCommand(n1,t=>{const[n]=Oa(t),r=X();if(n&&!W(r))return!1;const o=wy(t.clientX,t.clientY);if(o!==null){const i=Ut(o.node);Te(i)&&t.preventDefault()}return!0},be),e.registerCommand(jd,()=>(CA(),!0),be),e.registerCommand(tc,t=>(af(e,Pr(t,ClipboardEvent)?t:null),!0),be),e.registerCommand(nc,t=>((async function(n,r){await af(r,Pr(n,ClipboardEvent)?n:null),r.update(()=>{const o=X();W(o)?o.removeText():Ct(o)&&o.getNodes().forEach(i=>i.remove())})})(t,e),!0),be),e.registerCommand(yh,t=>{const[,n,r]=Oa(t);return n.length>0&&!r?(e.dispatchCommand(Sy,n),!0):Cn(t.target)&&Lh(t.target)?!1:X()!==null&&((function(o,i){o.preventDefault(),i.update(()=>{const s=X(),a=Pr(o,InputEvent)||Pr(o,KeyboardEvent)?null:o.clipboardData;a!=null&&s!==null&&vy(a,s,i)},{tag:J3})})(t,e),!0)},be),e.registerCommand(Qb,t=>{const n=X();return W(n)&&gu(n),!1},be),e.registerCommand(_h,t=>{const n=X();return W(n)&&gu(n),!1},be))}var pu={exports:{}},Ry;function KN(){return Ry||(Ry=1,(function(e){var t=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{};var n=(function(r){var o=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,i=0,s={},a={manual:r.Prism&&r.Prism.manual,disableWorkerMessageHandler:r.Prism&&r.Prism.disableWorkerMessageHandler,util:{encode:function y(x){return x instanceof l?new l(x.type,y(x.content),x.alias):Array.isArray(x)?x.map(y):x.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function(y){return Object.prototype.toString.call(y).slice(8,-1)},objId:function(y){return y.__id||Object.defineProperty(y,"__id",{value:++i}),y.__id},clone:function y(x,b){b=b||{};var w,_;switch(a.util.type(x)){case"Object":if(_=a.util.objId(x),b[_])return b[_];w={},b[_]=w;for(var E in x)x.hasOwnProperty(E)&&(w[E]=y(x[E],b));return w;case"Array":return _=a.util.objId(x),b[_]?b[_]:(w=[],b[_]=w,x.forEach(function(R,k){w[k]=y(R,b)}),w);default:return x}},getLanguage:function(y){for(;y;){var x=o.exec(y.className);if(x)return x[1].toLowerCase();y=y.parentElement}return"none"},setLanguage:function(y,x){y.className=y.className.replace(RegExp(o,"gi"),""),y.classList.add("language-"+x)},currentScript:function(){if(typeof document>"u")return null;if(document.currentScript&&document.currentScript.tagName==="SCRIPT")return document.currentScript;try{throw new Error}catch(w){var y=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(w.stack)||[])[1];if(y){var x=document.getElementsByTagName("script");for(var b in x)if(x[b].src==y)return x[b]}return null}},isActive:function(y,x,b){for(var w="no-"+x;y;){var _=y.classList;if(_.contains(x))return!0;if(_.contains(w))return!1;y=y.parentElement}return!!b}},languages:{plain:s,plaintext:s,text:s,txt:s,extend:function(y,x){var b=a.util.clone(a.languages[y]);for(var w in x)b[w]=x[w];return b},insertBefore:function(y,x,b,w){w=w||a.languages;var _=w[y],E={};for(var R in _)if(_.hasOwnProperty(R)){if(R==x)for(var k in b)b.hasOwnProperty(k)&&(E[k]=b[k]);b.hasOwnProperty(R)||(E[R]=_[R])}var M=w[y];return w[y]=E,a.languages.DFS(a.languages,function(F,D){D===M&&F!=y&&(this[F]=E)}),E},DFS:function y(x,b,w,_){_=_||{};var E=a.util.objId;for(var R in x)if(x.hasOwnProperty(R)){b.call(x,R,x[R],w||R);var k=x[R],M=a.util.type(k);M==="Object"&&!_[E(k)]?(_[E(k)]=!0,y(k,b,null,_)):M==="Array"&&!_[E(k)]&&(_[E(k)]=!0,y(k,b,R,_))}}},plugins:{},highlightAll:function(y,x){a.highlightAllUnder(document,y,x)},highlightAllUnder:function(y,x,b){var w={callback:b,container:y,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};a.hooks.run("before-highlightall",w),w.elements=Array.prototype.slice.apply(w.container.querySelectorAll(w.selector)),a.hooks.run("before-all-elements-highlight",w);for(var _=0,E;E=w.elements[_++];)a.highlightElement(E,x===!0,w.callback)},highlightElement:function(y,x,b){var w=a.util.getLanguage(y),_=a.languages[w];a.util.setLanguage(y,w);var E=y.parentElement;E&&E.nodeName.toLowerCase()==="pre"&&a.util.setLanguage(E,w);var R=y.textContent,k={element:y,language:w,grammar:_,code:R};function M(D){k.highlightedCode=D,a.hooks.run("before-insert",k),k.element.innerHTML=k.highlightedCode,a.hooks.run("after-highlight",k),a.hooks.run("complete",k),b&&b.call(k.element)}if(a.hooks.run("before-sanity-check",k),E=k.element.parentElement,E&&E.nodeName.toLowerCase()==="pre"&&!E.hasAttribute("tabindex")&&E.setAttribute("tabindex","0"),!k.code){a.hooks.run("complete",k),b&&b.call(k.element);return}if(a.hooks.run("before-highlight",k),!k.grammar){M(a.util.encode(k.code));return}if(x&&r.Worker){var F=new Worker(a.filename);F.onmessage=function(D){M(D.data)},F.postMessage(JSON.stringify({language:k.language,code:k.code,immediateClose:!0}))}else M(a.highlight(k.code,k.grammar,k.language))},highlight:function(y,x,b){var w={code:y,grammar:x,language:b};if(a.hooks.run("before-tokenize",w),!w.grammar)throw new Error('The language "'+w.language+'" has no grammar.');return w.tokens=a.tokenize(w.code,w.grammar),a.hooks.run("after-tokenize",w),l.stringify(a.util.encode(w.tokens),w.language)},tokenize:function(y,x){var b=x.rest;if(b){for(var w in b)x[w]=b[w];delete x.rest}var _=new f;return d(_,_.head,y),u(y,_,x,_.head,0),g(_)},hooks:{all:{},add:function(y,x){var b=a.hooks.all;b[y]=b[y]||[],b[y].push(x)},run:function(y,x){var b=a.hooks.all[y];if(!(!b||!b.length))for(var w=0,_;_=b[w++];)_(x)}},Token:l};r.Prism=a;function l(y,x,b,w){this.type=y,this.content=x,this.alias=b,this.length=(w||"").length|0}l.stringify=function y(x,b){if(typeof x=="string")return x;if(Array.isArray(x)){var w="";return x.forEach(function(M){w+=y(M,b)}),w}var _={type:x.type,content:y(x.content,b),tag:"span",classes:["token",x.type],attributes:{},language:b},E=x.alias;E&&(Array.isArray(E)?Array.prototype.push.apply(_.classes,E):_.classes.push(E)),a.hooks.run("wrap",_);var R="";for(var k in _.attributes)R+=" "+k+'="'+(_.attributes[k]||"").replace(/"/g,"&quot;")+'"';return"<"+_.tag+' class="'+_.classes.join(" ")+'"'+R+">"+_.content+"</"+_.tag+">"};function c(y,x,b,w){y.lastIndex=x;var _=y.exec(b);if(_&&w&&_[1]){var E=_[1].length;_.index+=E,_[0]=_[0].slice(E)}return _}function u(y,x,b,w,_,E){for(var R in b)if(!(!b.hasOwnProperty(R)||!b[R])){var k=b[R];k=Array.isArray(k)?k:[k];for(var M=0;M<k.length;++M){if(E&&E.cause==R+","+M)return;var F=k[M],D=F.inside,j=!!F.lookbehind,I=!!F.greedy,$=F.alias;if(I&&!F.pattern.global){var H=F.pattern.toString().match(/[imsuy]*$/)[0];F.pattern=RegExp(F.pattern.source,H+"g")}for(var O=F.pattern||F,P=w.next,K=_;P!==x.tail&&!(E&&K>=E.reach);K+=P.value.length,P=P.next){var G=P.value;if(x.length>y.length)return;if(!(G instanceof l)){var re=1,U;if(I){if(U=c(O,K,y,j),!U||U.index>=y.length)break;var oe=U.index,Z=U.index+U[0].length,Q=K;for(Q+=P.value.length;oe>=Q;)P=P.next,Q+=P.value.length;if(Q-=P.value.length,K=Q,P.value instanceof l)continue;for(var ne=P;ne!==x.tail&&(Q<Z||typeof ne.value=="string");ne=ne.next)re++,Q+=ne.value.length;re--,G=y.slice(K,Q),U.index-=K}else if(U=c(O,0,G,j),!U)continue;var oe=U.index,me=U[0],ee=G.slice(0,oe),xe=G.slice(oe+me.length),Se=K+G.length;E&&Se>E.reach&&(E.reach=Se);var Ee=P.prev;ee&&(Ee=d(x,Ee,ee),K+=ee.length),h(x,Ee,re);var ze=new l(R,D?a.tokenize(me,D):me,$,me);if(P=d(x,Ee,ze),xe&&d(x,P,xe),re>1){var je={cause:R+","+M,reach:Se};u(y,x,b,P.prev,K,je),E&&je.reach>E.reach&&(E.reach=je.reach)}}}}}}function f(){var y={value:null,prev:null,next:null},x={value:null,prev:y,next:null};y.next=x,this.head=y,this.tail=x,this.length=0}function d(y,x,b){var w=x.next,_={value:b,prev:x,next:w};return x.next=_,w.prev=_,y.length++,_}function h(y,x,b){for(var w=x.next,_=0;_<b&&w!==y.tail;_++)w=w.next;x.next=w,w.prev=x,y.length-=_}function g(y){for(var x=[],b=y.head.next;b!==y.tail;)x.push(b.value),b=b.next;return x}if(!r.document)return r.addEventListener&&(a.disableWorkerMessageHandler||r.addEventListener("message",function(y){var x=JSON.parse(y.data),b=x.language,w=x.code,_=x.immediateClose;r.postMessage(a.highlight(w,a.languages[b],b)),_&&r.close()},!1)),a;var p=a.util.currentScript();p&&(a.filename=p.src,p.hasAttribute("data-manual")&&(a.manual=!0));function m(){a.manual||a.highlightAll()}if(!a.manual){var v=document.readyState;v==="loading"||v==="interactive"&&p&&p.defer?document.addEventListener("DOMContentLoaded",m):window.requestAnimationFrame?window.requestAnimationFrame(m):window.setTimeout(m,16)}return a})(t);e.exports&&(e.exports=n),typeof Bn<"u"&&(Bn.Prism=n),n.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},n.languages.markup.tag.inside["attr-value"].inside.entity=n.languages.markup.entity,n.languages.markup.doctype.inside["internal-subset"].inside=n.languages.markup,n.hooks.add("wrap",function(r){r.type==="entity"&&(r.attributes.title=r.content.replace(/&amp;/,"&"))}),Object.defineProperty(n.languages.markup.tag,"addInlined",{value:function(o,i){var s={};s["language-"+i]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:n.languages[i]},s.cdata=/^<!\[CDATA\[|\]\]>$/i;var a={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:s}};a["language-"+i]={pattern:/[\s\S]+/,inside:n.languages[i]};var l={};l[o]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return o}),"i"),lookbehind:!0,greedy:!0,inside:a},n.languages.insertBefore("markup","cdata",l)}}),Object.defineProperty(n.languages.markup.tag,"addAttribute",{value:function(r,o){n.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+r+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[o,"language-"+o],inside:n.languages[o]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),n.languages.html=n.languages.markup,n.languages.mathml=n.languages.markup,n.languages.svg=n.languages.markup,n.languages.xml=n.languages.extend("markup",{}),n.languages.ssml=n.languages.xml,n.languages.atom=n.languages.xml,n.languages.rss=n.languages.xml,(function(r){var o=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;r.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+o.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+o.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+o.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+o.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:o,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},r.languages.css.atrule.inside.rest=r.languages.css;var i=r.languages.markup;i&&(i.tag.addInlined("style","css"),i.tag.addAttribute("style","css"))})(n),n.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},n.languages.javascript=n.languages.extend("clike",{"class-name":[n.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),n.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,n.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:n.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:n.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:n.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:n.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:n.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),n.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:n.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),n.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),n.languages.markup&&(n.languages.markup.tag.addInlined("script","javascript"),n.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),n.languages.js=n.languages.javascript,(function(){if(typeof n>"u"||typeof document>"u")return;Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var r="Loading…",o=function(p,m){return"✖ Error "+p+" while fetching file: "+m},i="✖ Error: File does not exist or is empty",s={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},a="data-src-status",l="loading",c="loaded",u="failed",f="pre[data-src]:not(["+a+'="'+c+'"]):not(['+a+'="'+l+'"])';function d(p,m,v){var y=new XMLHttpRequest;y.open("GET",p,!0),y.onreadystatechange=function(){y.readyState==4&&(y.status<400&&y.responseText?m(y.responseText):y.status>=400?v(o(y.status,y.statusText)):v(i))},y.send(null)}function h(p){var m=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(p||"");if(m){var v=Number(m[1]),y=m[2],x=m[3];return y?x?[v,Number(x)]:[v,void 0]:[v,v]}}n.hooks.add("before-highlightall",function(p){p.selector+=", "+f}),n.hooks.add("before-sanity-check",function(p){var m=p.element;if(m.matches(f)){p.code="",m.setAttribute(a,l);var v=m.appendChild(document.createElement("CODE"));v.textContent=r;var y=m.getAttribute("data-src"),x=p.language;if(x==="none"){var b=(/\.(\w+)$/.exec(y)||[,"none"])[1];x=s[b]||b}n.util.setLanguage(v,x),n.util.setLanguage(m,x);var w=n.plugins.autoloader;w&&w.loadLanguages(x),d(y,function(_){m.setAttribute(a,c);var E=h(m.getAttribute("data-range"));if(E){var R=_.split(/\r\n?|\n/g),k=E[0],M=E[1]==null?R.length:E[1];k<0&&(k+=R.length),k=Math.max(0,Math.min(k-1,R.length)),M<0&&(M+=R.length),M=Math.max(0,Math.min(M,R.length)),_=R.slice(k,M).join(`
48
+ `),m.hasAttribute("data-start")||m.setAttribute("data-start",String(k+1))}v.textContent=_,n.highlightElement(v)},function(_){m.setAttribute(a,u),v.textContent=_})}}),n.plugins.fileHighlight={highlight:function(m){for(var v=(m||document).querySelectorAll(f),y=0,x;x=v[y++];)n.highlightElement(x)}};var g=!1;n.fileHighlight=function(){g||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),g=!0),n.plugins.fileHighlight.highlight.apply(this,arguments)}})()})(pu)),pu.exports}KN();Prism.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/};Prism.languages.javascript=Prism.languages.extend("clike",{"class-name":[Prism.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/});Prism.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/;Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:Prism.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:Prism.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/});Prism.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:Prism.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}});Prism.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}});Prism.languages.markup&&(Prism.languages.markup.tag.addInlined("script","javascript"),Prism.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript"));Prism.languages.js=Prism.languages.javascript;Prism.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]};Prism.languages.markup.tag.inside["attr-value"].inside.entity=Prism.languages.markup.entity;Prism.languages.markup.doctype.inside["internal-subset"].inside=Prism.languages.markup;Prism.hooks.add("wrap",function(e){e.type==="entity"&&(e.attributes.title=e.content.replace(/&amp;/,"&"))});Object.defineProperty(Prism.languages.markup.tag,"addInlined",{value:function(t,n){var r={};r["language-"+n]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:Prism.languages[n]},r.cdata=/^<!\[CDATA\[|\]\]>$/i;var o={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:r}};o["language-"+n]={pattern:/[\s\S]+/,inside:Prism.languages[n]};var i={};i[t]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return t}),"i"),lookbehind:!0,greedy:!0,inside:o},Prism.languages.insertBefore("markup","cdata",i)}});Object.defineProperty(Prism.languages.markup.tag,"addAttribute",{value:function(e,t){Prism.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+e+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,"language-"+t],inside:Prism.languages[t]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}});Prism.languages.html=Prism.languages.markup;Prism.languages.mathml=Prism.languages.markup;Prism.languages.svg=Prism.languages.markup;Prism.languages.xml=Prism.languages.extend("markup",{});Prism.languages.ssml=Prism.languages.xml;Prism.languages.atom=Prism.languages.xml;Prism.languages.rss=Prism.languages.xml;(function(e){var t=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function n(u){return u=u.replace(/<inner>/g,function(){return t}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+u+")")}var r=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,o=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return r}),i=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source;e.languages.markdown=e.languages.extend("markup",{}),e.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:e.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+o+i+"(?:"+o+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+o+i+")(?:"+o+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(r),inside:e.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+o+")"+i+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+o+"$"),inside:{"table-header":{pattern:RegExp(r),alias:"important",inside:e.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:n(/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:n(/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:n(/(~~?)(?:(?!~)<inner>)+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:n(/!?\[(?:(?!\])<inner>)+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\])<inner>)+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach(function(u){["url","bold","italic","strike","code-snippet"].forEach(function(f){u!==f&&(e.languages.markdown[u].inside.content.inside[f]=e.languages.markdown[f])})}),e.hooks.add("after-tokenize",function(u){if(u.language!=="markdown"&&u.language!=="md")return;function f(d){if(!(!d||typeof d=="string"))for(var h=0,g=d.length;h<g;h++){var p=d[h];if(p.type!=="code"){f(p.content);continue}var m=p.content[1],v=p.content[3];if(m&&v&&m.type==="code-language"&&v.type==="code-block"&&typeof m.content=="string"){var y=m.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp");y=(/[a-z][\w-]*/i.exec(y)||[""])[0].toLowerCase();var x="language-"+y;v.alias?typeof v.alias=="string"?v.alias=[v.alias,x]:v.alias.push(x):v.alias=[x]}}}f(u.tokens)}),e.hooks.add("wrap",function(u){if(u.type==="code-block"){for(var f="",d=0,h=u.classes.length;d<h;d++){var g=u.classes[d],p=/language-(.+)/.exec(g);if(p){f=p[1];break}}var m=e.languages[f];if(m)u.content=e.highlight(c(u.content),m,f);else if(f&&f!=="none"&&e.plugins.autoloader){var v="md-"+new Date().valueOf()+"-"+Math.floor(Math.random()*1e16);u.attributes.id=v,e.plugins.autoloader.loadLanguages(f,function(){var y=document.getElementById(v);y&&(y.innerHTML=e.highlight(y.textContent,e.languages[f],f))})}}});var s=RegExp(e.languages.markup.tag.pattern.source,"gi"),a={amp:"&",lt:"<",gt:">",quot:'"'},l=String.fromCodePoint||String.fromCharCode;function c(u){var f=u.replace(s,"");return f=f.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,function(d,h){if(h=h.toLowerCase(),h[0]==="#"){var g;return h[1]==="x"?g=parseInt(h.slice(2),16):g=Number(h.slice(1)),l(g)}else{var p=a[h];return p||d}}),f}e.languages.md=e.languages.markdown})(Prism);Prism.languages.c=Prism.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/});Prism.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}});Prism.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},Prism.languages.c.string],char:Prism.languages.c.char,comment:Prism.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:Prism.languages.c}}}});Prism.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/});delete Prism.languages.c.boolean;(function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+t.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var n=e.languages.markup;n&&(n.tag.addInlined("style","css"),n.tag.addAttribute("style","css"))})(Prism);Prism.languages.objectivec=Prism.languages.extend("c",{string:{pattern:/@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},keyword:/\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|\|?|[~^%?*\/@]/});delete Prism.languages.objectivec["class-name"];Prism.languages.objc=Prism.languages.objectivec;Prism.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/};(function(e){var t=e.languages.powershell={comment:[{pattern:/(^|[^`])<#[\s\S]*?#>/,lookbehind:!0},{pattern:/(^|[^`])#.*/,lookbehind:!0}],string:[{pattern:/"(?:`[\s\S]|[^`"])*"/,greedy:!0,inside:null},{pattern:/'(?:[^']|'')*'/,greedy:!0}],namespace:/\[[a-z](?:\[(?:\[[^\]]*\]|[^\[\]])*\]|[^\[\]])*\]/i,boolean:/\$(?:false|true)\b/i,variable:/\$\w+\b/,function:[/\b(?:Add|Approve|Assert|Backup|Block|Checkpoint|Clear|Close|Compare|Complete|Compress|Confirm|Connect|Convert|ConvertFrom|ConvertTo|Copy|Debug|Deny|Disable|Disconnect|Dismount|Edit|Enable|Enter|Exit|Expand|Export|Find|ForEach|Format|Get|Grant|Group|Hide|Import|Initialize|Install|Invoke|Join|Limit|Lock|Measure|Merge|Move|New|Open|Optimize|Out|Ping|Pop|Protect|Publish|Push|Read|Receive|Redo|Register|Remove|Rename|Repair|Request|Reset|Resize|Resolve|Restart|Restore|Resume|Revoke|Save|Search|Select|Send|Set|Show|Skip|Sort|Split|Start|Step|Stop|Submit|Suspend|Switch|Sync|Tee|Test|Trace|Unblock|Undo|Uninstall|Unlock|Unprotect|Unpublish|Unregister|Update|Use|Wait|Watch|Where|Write)-[a-z]+\b/i,/\b(?:ac|cat|chdir|clc|cli|clp|clv|compare|copy|cp|cpi|cpp|cvpa|dbp|del|diff|dir|ebp|echo|epal|epcsv|epsn|erase|fc|fl|ft|fw|gal|gbp|gc|gci|gcs|gdr|gi|gl|gm|gp|gps|group|gsv|gu|gv|gwmi|iex|ii|ipal|ipcsv|ipsn|irm|iwmi|iwr|kill|lp|ls|measure|mi|mount|move|mp|mv|nal|ndr|ni|nv|ogv|popd|ps|pushd|pwd|rbp|rd|rdr|ren|ri|rm|rmdir|rni|rnp|rp|rv|rvpa|rwmi|sal|saps|sasv|sbp|sc|select|set|shcm|si|sl|sleep|sls|sort|sp|spps|spsv|start|sv|swmi|tee|trcm|type|write)\b/i],keyword:/\b(?:Begin|Break|Catch|Class|Continue|Data|Define|Do|DynamicParam|Else|ElseIf|End|Exit|Filter|Finally|For|ForEach|From|Function|If|InlineScript|Parallel|Param|Process|Return|Sequence|Switch|Throw|Trap|Try|Until|Using|Var|While|Workflow)\b/i,operator:{pattern:/(^|\W)(?:!|-(?:b?(?:and|x?or)|as|(?:Not)?(?:Contains|In|Like|Match)|eq|ge|gt|is(?:Not)?|Join|le|lt|ne|not|Replace|sh[lr])\b|-[-=]?|\+[+=]?|[*\/%]=?)/i,lookbehind:!0},punctuation:/[|{}[\];(),.]/};t.string[0].inside={function:{pattern:/(^|[^`])\$\((?:\$\([^\r\n()]*\)|(?!\$\()[^\r\n)])*\)/,lookbehind:!0,inside:t},boolean:t.boolean,variable:t.variable}})(Prism);var ky={},Ay;function UN(){return Ay||(Ay=1,Prism.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},Prism.languages.python["string-interpolation"].inside.interpolation.inside.rest=Prism.languages.python,Prism.languages.py=Prism.languages.python),ky}UN();var Ny={},My;function GN(){return My||(My=1,(function(e){for(var t=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source,n=0;n<2;n++)t=t.replace(/<self>/g,function(){return t});t=t.replace(/<self>/g,function(){return/[^\s\S]/.source}),e.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+t),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:"attr-name",inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:"punctuation"},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:"symbol"},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:"punctuation"},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:"function"},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:"class-name"},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:"namespace"},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:"namespace",inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:"property"},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},e.languages.rust["closure-params"].inside.rest=e.languages.rust,e.languages.rust.attribute.inside.string=e.languages.rust.string})(Prism)),Ny}GN();Prism.languages.swift={comment:{pattern:/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,lookbehind:!0,greedy:!0},"string-literal":[{pattern:RegExp(/(^|[^"#])/.source+"(?:"+/"(?:\\(?:\((?:[^()]|\([^()]*\))*\)|\r\n|[^(])|[^\\\r\n"])*"/.source+"|"+/"""(?:\\(?:\((?:[^()]|\([^()]*\))*\)|[^(])|[^\\"]|"(?!""))*"""/.source+")"+/(?!["#])/.source),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:"punctuation"},punctuation:/\\(?=[\r\n])/,string:/[\s\S]+/}},{pattern:RegExp(/(^|[^"#])(#+)/.source+"(?:"+/"(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|\r\n|[^#])|[^\\\r\n])*?"/.source+"|"+/"""(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|[^#])|[^\\])*?"""/.source+")\\2"),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:"punctuation"},string:/[\s\S]+/}}],directive:{pattern:RegExp(/#/.source+"(?:"+(/(?:elseif|if)\b/.source+"(?:[ ]*"+/(?:![ \t]*)?(?:\b\w+\b(?:[ \t]*\((?:[^()]|\([^()]*\))*\))?|\((?:[^()]|\([^()]*\))*\))(?:[ \t]*(?:&&|\|\|))?/.source+")+")+"|"+/(?:else|endif)\b/.source+")"),alias:"property",inside:{"directive-name":/^#\w+/,boolean:/\b(?:false|true)\b/,number:/\b\d+(?:\.\d+)*\b/,operator:/!|&&|\|\||[<>]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:"constant"},"other-directive":{pattern:/#\w+\b/,alias:"property"},attribute:{pattern:/@\w+/,alias:"atrule"},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:"function"},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:"important"},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:"constant"},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:"keyword"},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/};Prism.languages.swift["string-literal"].forEach(function(e){e.inside.interpolation.inside=Prism.languages.swift});var Py={},Ly;function qN(){return Ly||(Ly=1,(function(e){e.languages.typescript=e.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),e.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete e.languages.typescript.parameter,delete e.languages.typescript["literal-property"];var t=e.languages.extend("typescript",{});delete t["class-name"],e.languages.typescript["class-name"].inside=t,e.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:t}}}}),e.languages.ts=e.languages.typescript})(Prism)),Py}qN();var Fy={},$y;function YN(){return $y||($y=1,(function(e){var t=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,n=/(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,r={pattern:RegExp(/(^|[^\w.])/.source+n+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};e.languages.java=e.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[r,{pattern:RegExp(/(^|[^\w.])/.source+n+/[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),lookbehind:!0,inside:r.inside},{pattern:RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source+n+/[A-Z]\w*\b/.source),lookbehind:!0,inside:r.inside}],keyword:t,function:[e.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0},constant:/\b[A-Z][A-Z_\d]+\b/}),e.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),e.languages.insertBefore("java","class-name",{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:"punctuation"},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":r,keyword:t,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(/(\bimport\s+)/.source+n+/(?:[A-Z]\w*|\*)(?=\s*;)/.source),lookbehind:!0,inside:{namespace:r.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(/(\bimport\s+static\s+)/.source+n+/(?:\w+|\*)(?=\s*;)/.source),lookbehind:!0,alias:"static",inside:{namespace:r.inside.namespace,static:/\b\w+$/,punctuation:/\./,operator:/\*/,"class-name":/\w+/}}],namespace:{pattern:RegExp(/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!<keyword>)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(/<keyword>/g,function(){return t.source})),lookbehind:!0,inside:{punctuation:/\./}}})})(Prism)),Fy}YN();var Oy={},Iy;function XN(){return Iy||(Iy=1,(function(e){var t=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,n=/\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g,function(){return t.source});e.languages.cpp=e.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g,function(){return t.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:t,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),e.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/<mod-name>(?:\s*:\s*<mod-name>)?|:\s*<mod-name>/.source.replace(/<mod-name>/g,function(){return n})+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),e.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:e.languages.cpp}}}}),e.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),e.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:e.languages.extend("cpp",{})}}),e.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},e.languages.cpp["base-clause"])})(Prism)),Oy}XN();function Lw(e,t){for(const n of e.childNodes){if(Be(n)&&n.tagName===t)return!0;Lw(n,t)}return!1}const Ss="data-language",ds="data-highlight-language",Ia="data-theme";let gc=class Fw extends Tt{__language;__theme;__isSyntaxHighlightSupported;static getType(){return"code"}static clone(t){return new Fw(t.__language,t.__key)}constructor(t,n){super(n),this.__language=t||void 0,this.__isSyntaxHighlightSupported=!1,this.__theme=void 0}afterCloneFrom(t){super.afterCloneFrom(t),this.__language=t.__language,this.__theme=t.__theme,this.__isSyntaxHighlightSupported=t.__isSyntaxHighlightSupported}createDOM(t){const n=document.createElement("code");et(n,t.theme.code),n.setAttribute("spellcheck","false");const r=this.getLanguage();r&&(n.setAttribute(Ss,r),this.getIsSyntaxHighlightSupported()&&n.setAttribute(ds,r));const o=this.getTheme();o&&n.setAttribute(Ia,o);const i=this.getStyle();return i&&n.setAttribute("style",i),n}updateDOM(t,n,r){const o=this.__language,i=t.__language;o?o!==i&&n.setAttribute(Ss,o):i&&n.removeAttribute(Ss);const s=this.__isSyntaxHighlightSupported;t.__isSyntaxHighlightSupported&&i?s&&o?o!==i&&n.setAttribute(ds,o):n.removeAttribute(ds):s&&o&&n.setAttribute(ds,o);const a=this.__theme,l=t.__theme;a?a!==l&&n.setAttribute(Ia,a):l&&n.removeAttribute(Ia);const c=this.__style,u=t.__style;return c?c!==u&&n.setAttribute("style",c):u&&n.removeAttribute("style"),!1}exportDOM(t){const n=document.createElement("pre");et(n,t._config.theme.code),n.setAttribute("spellcheck","false");const r=this.getLanguage();r&&(n.setAttribute(Ss,r),this.getIsSyntaxHighlightSupported()&&n.setAttribute(ds,r));const o=this.getTheme();o&&n.setAttribute(Ia,o);const i=this.getStyle();return i&&n.setAttribute("style",i),{element:n}}static importDOM(){return{code:t=>t.textContent!=null&&(/\r?\n/.test(t.textContent)||Lw(t,"BR"))?{conversion:Dy,priority:1}:null,div:()=>({conversion:ZN,priority:1}),pre:()=>({conversion:Dy,priority:0}),table:t=>mu(t)?{conversion:JN,priority:3}:null,td:t=>{const n=t,r=n.closest("table");return n.classList.contains("js-file-line")||r&&mu(r)?{conversion:jy,priority:3}:null},tr:t=>{const n=t.closest("table");return n&&mu(n)?{conversion:jy,priority:3}:null}}}static importJSON(t){return hr().updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setLanguage(t.language).setTheme(t.theme)}exportJSON(){return{...super.exportJSON(),language:this.getLanguage(),theme:this.getTheme()}}insertNewAfter(t,n=!0){const r=this.getChildren(),o=r.length;if(o>=2&&r[o-1].getTextContent()===`
49
49
  `&&r[o-2].getTextContent()===`
50
- `&&t.isCollapsed()&&t.anchor.key===this.__key&&t.anchor.offset===o){r[o-1].remove(),r[o-2].remove();const l=ye();return this.insertAfter(l,n),l}const{anchor:i,focus:s}=t,a=(i.isBefore(s)?i:s).getNode();if(X(a)){let l=ZM(a);const c=[];for(;;)if(Yl(l))c.push(Vi()),l=l.getNextSibling();else{if(!Lw(l))break;{let m=0;const x=l.getTextContent(),y=l.getTextContentSize();for(;m<y&&x[m]===" ";)m++;if(m!==0&&c.push(Pw(" ".repeat(m))),m!==y)break;l=l.getNextSibling()}}const u=a.splitText(i.offset)[0],f=i.offset===0?0:1,d=u.getIndexWithinParent()+f,h=a.getParentOrThrow(),g=[Tn(),...c];h.splice(d,0,g);const p=c[c.length-1];p?p.select():i.offset===0?u.selectPrevious():u.getNextSibling().selectNext(0,0)}if(Wh(a)){const{offset:l}=t.anchor;a.splice(l,0,[Tn()]),a.select(l+1,l+1)}return null}canIndent(){return!1}collapseAtStart(){const t=ye();return this.getChildren().forEach(n=>t.append(n)),this.replace(t),!0}setLanguage(t){const n=this.getWritable();return n.__language=t||void 0,n}getLanguage(){return this.getLatest().__language}setIsSyntaxHighlightSupported(t){const n=this.getWritable();return n.__isSyntaxHighlightSupported=t,n}getIsSyntaxHighlightSupported(){return this.getLatest().__isSyntaxHighlightSupported}setTheme(t){const n=this.getWritable();return n.__theme=t||void 0,n}getTheme(){return this.getLatest().__theme}};function ur(e,t){return Db(sc).setLanguage(e).setTheme(t)}function Wh(e){return e instanceof sc}function $y(e){return{node:ur(e.getAttribute(ps))}}function qM(e){const t=e,n=Iy(t);return n||(function(r){let o=r.parentElement;for(;o!==null;){if(Iy(o))return!0;o=o.parentElement}return!1})(t)?{node:n?ur():null}:{node:null}}function YM(){return{node:ur()}}function Oy(){return{node:null}}function Iy(e){return e.style.fontFamily.match("monospace")!==null}function lu(e){return e.classList.contains("js-file-line-container")}let Mw=class Nw extends un{__highlightType;constructor(t="",n,r){super(t,r),this.__highlightType=n}static getType(){return"code-highlight"}static clone(t){return new Nw(t.__text,t.__highlightType||void 0,t.__key)}getHighlightType(){return this.getLatest().__highlightType}setHighlightType(t){const n=this.getWritable();return n.__highlightType=t||void 0,n}canHaveFormat(){return!1}createDOM(t){const n=super.createDOM(t),r=cu(t.theme,this.__highlightType);return Qe(n,r),n}updateDOM(t,n,r){const o=super.updateDOM(t,n,r),i=cu(r.theme,t.__highlightType),s=cu(r.theme,this.__highlightType);return i!==s&&(i&&Un(n,i),s&&Qe(n,s)),o}static importJSON(t){return Pw().updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setHighlightType(t.highlightType)}exportJSON(){return{...super.exportJSON(),highlightType:this.getHighlightType()}}setFormat(t){return this}isParentRequired(){return!0}createParentElementNode(){return ur()}};function cu(e,t){return t&&e&&e.codeHighlight&&e.codeHighlight[t]}function Pw(e="",t){return _t(new Mw(e,t))}function Lw(e){return e instanceof Mw}function XM(e,t){let n=e;for(let r=tt(e,t);r&&(Lw(r.origin)||Yl(r.origin));r=GA(r))n=r.origin;return n}function ZM(e){return XM(e,"previous")}(function(e){e.languages.diff={coord:[/^(?:\*{3}|-{3}|\+{3}).*$/m,/^@@.*@@$/m,/^\d.*$/m]};var t={"deleted-sign":"-","deleted-arrow":"<","inserted-sign":"+","inserted-arrow":">",unchanged:" ",diff:"!"};Object.keys(t).forEach(function(n){var r=t[n],o=[];/^\w+$/.test(n)||o.push(/\w+/.exec(n)[0]),n==="diff"&&o.push("bold"),e.languages.diff[n]={pattern:RegExp("^(?:["+r+`].*(?:\r
50
+ `&&t.isCollapsed()&&t.anchor.key===this.__key&&t.anchor.offset===o){r[o-1].remove(),r[o-2].remove();const l=ve();return this.insertAfter(l,n),l}const{anchor:i,focus:s}=t,a=(i.isBefore(s)?i:s).getNode();if(J(a)){let l=eM(a);const c=[];for(;;)if(rc(l))c.push(qi()),l=l.getNextSibling();else{if(!Dw(l))break;{let m=0;const v=l.getTextContent(),y=l.getTextContentSize();for(;m<y&&v[m]===" ";)m++;if(m!==0&&c.push(Iw(" ".repeat(m))),m!==y)break;l=l.getNextSibling()}}const u=a.splitText(i.offset)[0],f=i.offset===0?0:1,d=u.getIndexWithinParent()+f,h=a.getParentOrThrow(),g=[kn(),...c];h.splice(d,0,g);const p=c[c.length-1];p?p.select():i.offset===0?u.selectPrevious():u.getNextSibling().selectNext(0,0)}if(Jh(a)){const{offset:l}=t.anchor;a.splice(l,0,[kn()]),a.select(l+1,l+1)}return null}canIndent(){return!1}collapseAtStart(){const t=ve();return this.getChildren().forEach(n=>t.append(n)),this.replace(t),!0}setLanguage(t){const n=this.getWritable();return n.__language=t||void 0,n}getLanguage(){return this.getLatest().__language}setIsSyntaxHighlightSupported(t){const n=this.getWritable();return n.__isSyntaxHighlightSupported=t,n}getIsSyntaxHighlightSupported(){return this.getLatest().__isSyntaxHighlightSupported}setTheme(t){const n=this.getWritable();return n.__theme=t||void 0,n}getTheme(){return this.getLatest().__theme}};function hr(e,t){return H1(gc).setLanguage(e).setTheme(t)}function Jh(e){return e instanceof gc}function Dy(e){return{node:hr(e.getAttribute(Ss))}}function ZN(e){const t=e,n=Vy(t);return n||(function(r){let o=r.parentElement;for(;o!==null;){if(Vy(o))return!0;o=o.parentElement}return!1})(t)?{node:n?hr():null}:{node:null}}function JN(){return{node:hr()}}function jy(){return{node:null}}function Vy(e){return e.style.fontFamily.match("monospace")!==null}function mu(e){return e.classList.contains("js-file-line-container")}let $w=class Ow extends fn{__highlightType;constructor(t="",n,r){super(t,r),this.__highlightType=n}static getType(){return"code-highlight"}static clone(t){return new Ow(t.__text,t.__highlightType||void 0,t.__key)}getHighlightType(){return this.getLatest().__highlightType}setHighlightType(t){const n=this.getWritable();return n.__highlightType=t||void 0,n}canHaveFormat(){return!1}createDOM(t){const n=super.createDOM(t),r=yu(t.theme,this.__highlightType);return et(n,r),n}updateDOM(t,n,r){const o=super.updateDOM(t,n,r),i=yu(r.theme,t.__highlightType),s=yu(r.theme,this.__highlightType);return i!==s&&(i&&Yn(n,i),s&&et(n,s)),o}static importJSON(t){return Iw().updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setHighlightType(t.highlightType)}exportJSON(){return{...super.exportJSON(),highlightType:this.getHighlightType()}}setFormat(t){return this}isParentRequired(){return!0}createParentElementNode(){return hr()}};function yu(e,t){return t&&e&&e.codeHighlight&&e.codeHighlight[t]}function Iw(e="",t){return Et(new $w(e,t))}function Dw(e){return e instanceof $w}function QN(e,t){let n=e;for(let r=nt(e,t);r&&(Dw(r.origin)||rc(r.origin));r=XA(r))n=r.origin;return n}function eM(e){return QN(e,"previous")}(function(e){e.languages.diff={coord:[/^(?:\*{3}|-{3}|\+{3}).*$/m,/^@@.*@@$/m,/^\d.*$/m]};var t={"deleted-sign":"-","deleted-arrow":"<","inserted-sign":"+","inserted-arrow":">",unchanged:" ",diff:"!"};Object.keys(t).forEach(function(n){var r=t[n],o=[];/^\w+$/.test(n)||o.push(/\w+/.exec(n)[0]),n==="diff"&&o.push("bold"),e.languages.diff[n]={pattern:RegExp("^(?:["+r+`].*(?:\r
51
51
  ?|
52
- |(?![\\s\\S])))+`,"m"),alias:o,inside:{line:{pattern:/(.)(?=[\s\S]).*(?:\r\n?|\n)?/,lookbehind:!0},prefix:{pattern:/[\s\S]/,alias:/\w+/.exec(n)[0]}}}}),Object.defineProperty(e.languages.diff,"PREFIXES",{value:t})})(Prism);const JM=new Set(["http:","https:","mailto:","sms:","tel:"]);let ra=class Fw extends St{__url;__target;__rel;__title;static getType(){return"link"}static clone(t){return new Fw(t.__url,{rel:t.__rel,target:t.__target,title:t.__title},t.__key)}constructor(t="",n={},r){super(r);const{target:o=null,rel:i=null,title:s=null}=n;this.__url=t,this.__target=o,this.__rel=i,this.__title=s}createDOM(t){const n=document.createElement("a");return this.updateLinkDOM(null,n,t),Qe(n,t.theme.link),n}updateLinkDOM(t,n,r){if(Ob(n)){t&&t.__url===this.__url||(n.href=this.sanitizeUrl(this.__url));for(const o of["target","rel","title"]){const i=`__${o}`,s=this[i];t&&t[i]===s||(s?n[o]=s:n.removeAttribute(o))}}}updateDOM(t,n,r){return this.updateLinkDOM(t,n,r),!1}static importDOM(){return{a:t=>({conversion:QM,priority:1})}}static importJSON(t){return kl().updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setURL(t.url).setRel(t.rel||null).setTarget(t.target||null).setTitle(t.title||null)}sanitizeUrl(t){t=jy(t);try{const n=new URL(jy(t));if(!JM.has(n.protocol))return"about:blank"}catch{return t}return t}exportJSON(){return{...super.exportJSON(),rel:this.getRel(),target:this.getTarget(),title:this.getTitle(),url:this.getURL()}}getURL(){return this.getLatest().__url}setURL(t){const n=this.getWritable();return n.__url=t,n}getTarget(){return this.getLatest().__target}setTarget(t){const n=this.getWritable();return n.__target=t,n}getRel(){return this.getLatest().__rel}setRel(t){const n=this.getWritable();return n.__rel=t,n}getTitle(){return this.getLatest().__title}setTitle(t){const n=this.getWritable();return n.__title=t,n}insertNewAfter(t,n=!0){const r=kl(this.__url,{rel:this.__rel,target:this.__target,title:this.__title});return this.insertAfter(r,n),r}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(t,n,r){if(!W(n))return!1;const o=n.anchor.getNode(),i=n.focus.getNode();return this.isParentOf(o)&&this.isParentOf(i)&&n.getTextContent().length>0}isEmailURI(){return this.__url.startsWith("mailto:")}isWebSiteURI(){return this.__url.startsWith("https://")||this.__url.startsWith("http://")}};function QM(e){let t=null;if(Ob(e)){const n=e.textContent;(n!==null&&n!==""||e.children.length>0)&&(t=kl(e.getAttribute("href")||"",{rel:e.getAttribute("rel"),target:e.getAttribute("target"),title:e.getAttribute("title")}))}return{node:t}}function kl(e="",t){return _t(new ra(e,t))}function eN(e){return e instanceof ra}class oa extends ra{__isUnlinked;constructor(t="",n={},r){super(t,n,r),this.__isUnlinked=n.isUnlinked!==void 0&&n.isUnlinked!==null&&n.isUnlinked}static getType(){return"autolink"}static clone(t){return new oa(t.__url,{isUnlinked:t.__isUnlinked,rel:t.__rel,target:t.__target,title:t.__title},t.__key)}getIsUnlinked(){return this.__isUnlinked}setIsUnlinked(t){const n=this.getWritable();return n.__isUnlinked=t,n}createDOM(t){return this.__isUnlinked?document.createElement("span"):super.createDOM(t)}updateDOM(t,n,r){return super.updateDOM(t,n,r)||t.__isUnlinked!==this.__isUnlinked}static importJSON(t){return Dy().updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setIsUnlinked(t.isUnlinked||!1)}static importDOM(){return null}exportJSON(){return{...super.exportJSON(),isUnlinked:this.__isUnlinked}}insertNewAfter(t,n=!0){const r=this.getParentOrThrow().insertNewAfter(t,n);if(B(r)){const o=Dy(this.__url,{isUnlinked:this.__isUnlinked,rel:this.__rel,target:this.__target,title:this.__title});return r.append(o),o}return null}}function Dy(e="",t){return _t(new oa(e,t))}function tN(e){return e instanceof oa}const nN=/^\+?[0-9\s()-]{5,}$/;function jy(e){return e.match(/^[a-z][a-z0-9+.-]*:/i)||e.match(/^[/#.]/)?e:e.includes("@")?`mailto:${e}`:nN.test(e)?`tel:${e}`:`https://${e}`}function Qd(e,t){const n={};for(const r of e){const o=t(r);o&&(n[o]?n[o].push(r):n[o]=[r])}return n}function Kh(e){const t=Qd(e,n=>n.type);return{element:t.element||[],multilineElement:t["multiline-element"]||[],textFormat:t["text-format"]||[],textMatch:t["text-match"]||[]}}const Al=/[!-/:-@[-`{-~\s]/,rN=/^\s{0,3}$/;function ef(e){if(!Yr(e))return!1;const t=e.getFirstChild();return t==null||e.getChildrenSize()===1&&X(t)&&rN.test(t.getTextContent())}function oN(e,t,n,r){for(const o of t){if(!o.export)continue;const i=o.export(e,s=>Ml(s,n,r));if(i!=null)return i}return B(e)?Ml(e,n,r):_e(e)?e.getTextContent():null}function Ml(e,t,n,r,o){const i=[],s=e.getChildren();r||(r=[]),o||(o=[]);e:for(const a of s){for(const l of n){if(!l.export)continue;const c=l.export(a,u=>Ml(u,t,n,r,[...o,...r]),(u,f)=>Vy(u,f,t,r,o));if(c!=null){i.push(c);continue e}}zn(a)?i.push(`
53
- `):X(a)?i.push(Vy(a,a.getTextContent(),t,r,o)):B(a)?i.push(Ml(a,t,n,r,o)):_e(a)&&i.push(a.getTextContent())}return i.join("")}function Vy(e,t,n,r,o){let i=e.getFormat()===0?t:(function(d){return d.replace(/^\s+|\s+$/g,h=>[...h].map(g=>"&#"+g.codePointAt(0)+";").join(""))})(t);e.hasFormat("code")||(i=i.replace(/([*_`~\\])/g,"\\$1"));let s="",a="",l="";const c=By(e,!0),u=By(e,!1),f=new Set;for(const d of n){const h=d.format[0],g=d.tag;Ma(e,h)&&!f.has(h)&&(f.add(h),Ma(c,h)&&r.find(p=>p.tag===g)||(r.push({format:h,tag:g}),s+=g))}for(let d=0;d<r.length;d++){const h=Ma(e,r[d].format),g=Ma(u,r[d].format);if(h&&g)continue;const p=[...r];for(;p.length>d;){const m=p.pop();o&&m&&o.find(x=>x.tag===m.tag)||(m&&typeof m.tag=="string"&&(h?g||(l+=m.tag):a+=m.tag),r.pop())}break}return i=s+i+l,a+i}function By(e,t){let n=t?e.getPreviousSibling():e.getNextSibling();if(!n){const r=e.getParentOrThrow();r.isInline()&&(n=t?r.getPreviousSibling():r.getNextSibling())}for(;n;){if(B(n)){if(!n.isInline())break;const r=t?n.getLastDescendant():n.getFirstDescendant();if(X(r))return r;n=t?n.getPreviousSibling():n.getNextSibling()}if(X(n))return n;if(!B(n))return null}return null}function Ma(e,t){return X(e)&&e.hasFormat(t)}function iN(e,t){const n=(function(o,i){const s=o.match(i.openTagsRegExp);if(s==null)return null;for(const a of s){const l=a.replace(/^\s/,""),c=i.fullMatchRegExpByTag[l];if(c==null)continue;const u=o.match(c),f=i.transformersByTag[l];if(u!=null&&f!=null){if(f.intraword!==!1)return u;const{index:d=0}=u,h=o[d-1],g=o[d+u[0].length];if((!h||Al.test(h))&&(!g||Al.test(g)))return u}}return null})(e.getTextContent(),t);if(!n)return null;const r=n.index||0;return{endIndex:r+n[0].length,match:n,startIndex:r,transformer:t.transformersByTag[n[1]]}}function so(e){return X(e)&&!e.hasFormat("code")}function ao(e,t,n){let r=iN(e,t),o=(function(s,a){const l=s;let c,u,f,d;for(const h of a){if(!h.replace||!h.importRegExp)continue;const g=l.getTextContent().match(h.importRegExp);if(!g)continue;const p=g.index||0,m=h.getEndIndex?h.getEndIndex(l,g):p+g[0].length;m!==!1&&(c===void 0||u===void 0||p<c&&(m>u||m<=c))&&(c=p,u=m,f=h,d=g)}return c===void 0||u===void 0||f===void 0||d===void 0?null:{endIndex:u,match:d,startIndex:c,transformer:f}})(e,n);if(r&&o&&(r.startIndex<=o.startIndex&&r.endIndex>=o.endIndex||o.startIndex>r.endIndex?o=null:r=null),r){const s=(function(a,l,c,u,f){const d=a.getTextContent();let h,g,p;if(f[0]===d?h=a:l===0?[h,g]=a.splitText(c):[p,h,g]=a.splitText(l,c),h.setTextContent(f[2]),u)for(const m of u.format)h.hasFormat(m)||h.toggleFormat(m);return{nodeAfter:g,nodeBefore:p,transformedNode:h}})(e,r.startIndex,r.endIndex,r.transformer,r.match);so(s.nodeAfter)&&ao(s.nodeAfter,t,n),so(s.nodeBefore)&&ao(s.nodeBefore,t,n),so(s.transformedNode)&&ao(s.transformedNode,t,n)}else if(o){const s=(function(a,l,c,u,f){let d,h,g;return l===0?[d,h]=a.splitText(c):[g,d,h]=a.splitText(l,c),u.replace?{nodeAfter:h,nodeBefore:g,transformedNode:u.replace(d,f)||void 0}:null})(e,o.startIndex,o.endIndex,o.transformer,o.match);if(!s)return;so(s.nodeAfter)&&ao(s.nodeAfter,t,n),so(s.nodeBefore)&&ao(s.nodeBefore,t,n),so(s.transformedNode)&&ao(s.transformedNode,t,n)}const i=e.getTextContent().replace(/\\([*_`~\\])/g,"$1").replace(/&#(\d+);/g,(s,a)=>String.fromCodePoint(a));e.setTextContent(i)}function sN(e,t=!1){const n=Kh(e),r=(function(o){const i={},s={},a=[],l="(?<![\\\\])";for(const c of o){const{tag:u}=c;i[u]=c;const f=u.replace(/(\*|\^|\+)/g,"\\$1");a.push(f),u.length===1?s[u]=u==="`"?new RegExp("(?<![\\\\`])(`)((?:\\\\`|[^`])+?)(`)(?!`)"):new RegExp(`(?<![\\\\${f}])(${f})((\\\\${f})?.*?[^${f}\\s](\\\\${f})?)((?<!\\\\)|(?<=\\\\\\\\))(${f})(?![\\\\${f}])`):s[u]=new RegExp(`(?<!\\\\)(${f})((\\\\${f})?.*?[^\\s](\\\\${f})?)((?<!\\\\)|(?<=\\\\\\\\))(${f})(?!\\\\)`)}return{fullMatchRegExpByTag:s,openTagsRegExp:new RegExp(`${l}(${a.join("|")})`,"g"),transformersByTag:i}})(n.textFormat);return(o,i)=>{const s=o.split(`
54
- `),a=s.length,l=i||qe();l.clear();for(let u=0;u<a;u++){const f=s[u],[d,h]=aN(s,u,n.multilineElement,l);d?u=h:lN(f,l,n.element,r,n.textMatch,t)}const c=l.getChildren();for(const u of c)!t&&ef(u)&&l.getChildrenSize()>1&&u.remove();Y()!==null&&l.selectStart()}}function aN(e,t,n,r){for(const o of n){const{handleImportAfterStartMatch:i,regExpEnd:s,regExpStart:a,replace:l}=o,c=e[t].match(a);if(!c)continue;if(i){const g=i({lines:e,rootNode:r,startLineIndex:t,startMatch:c,transformer:o});if(g===null)continue;if(g)return g}const u=typeof s=="object"&&"regExp"in s?s.regExp:s,f=s&&typeof s=="object"&&"optional"in s?s.optional:!s;let d=t;const h=e.length;for(;d<h;){const g=u?e[d].match(u):null;if(!g&&(!f||f&&d<h-1)){d++;continue}if(g&&t===d&&g.index===c.index){d++;continue}const p=[];if(g&&t===d)p.push(e[t].slice(c[0].length,-g[0].length));else for(let m=t;m<=d;m++)if(m===t){const x=e[m].slice(c[0].length);p.push(x)}else if(m===d&&g){const x=e[m].slice(0,-g[0].length);p.push(x)}else p.push(e[m]);if(l(r,null,c,g,p,!0)!==!1)return[!0,d];break}}return[!1,t]}function lN(e,t,n,r,o,i){const s=Fe(e),a=ye();a.append(s),t.append(a);for(const{regExp:l,replace:c}of n){const u=e.match(l);if(u&&(s.setTextContent(e.slice(u[0].length)),c(a,[s],u,!0)!==!1))break}if(ao(s,r,o),a.isAttached()&&e.length>0){const l=a.getPreviousSibling();if(!i&&(Yr(l)||Jd(l)||pe(l))){let c=l;if(pe(l)){const u=l.getLastDescendant();c=u==null?null:we(u,ke)}c!=null&&c.getTextContentSize()>0&&(c.splice(c.getChildrenSize(),0,[Tn(),...a.getChildren()]),a.remove())}}}function cN(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const o of t)r.append("v",o);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const $w=/^(\s*)(\d{1,})\.\s/,Ow=/^(\s*)[-*+]\s/,uN=/^(\s*)(?:[-*+]\s)?\s?(\[(\s|x)?\])\s/i,tf=/^(#{1,6})\s/,Iw=/^>\s/,Dw=/^[ \t]*```([\w-]+)?/,nf=/[ \t]*```$/,dN=/^[ \t]*```[^`]+(?:(?:`{1,2}|`{4,})[^`]+)*```(?:[^`]|$)/,fN=/^(?:\|)(.+)(?:\|)\s?$/,hN=/^(\| ?:?-*:? ?)+\|\s?$/,zy=/^<[a-z_][\w-]*(?:\s[^<>]*)?\/?>/i,Hy=/^<\/[a-z_][\w-]*\s*>/i,Wy=e=>new RegExp(`(?:${e.source})$`,e.flags),ms=k3("mdListMarker",{parse:e=>typeof e=="string"&&/^[-*+]$/.test(e)?e:"-"}),jw=e=>(t,n,r,o)=>{const i=e(r);i.append(...n),t.replace(i),o||i.select(0,0)},Vw=e=>(t,n,r,o)=>{const i=t.getPreviousSibling(),s=t.getNextSibling(),a=Gt(e==="check"?r[3]==="x":void 0),l=r[0].trim()[0],c=e!=="bullet"&&e!=="check"||l!==ms.parse(l)?void 0:l;if(pe(s)&&s.getListType()===e){c&&Uc(s,ms,c);const f=s.getFirstChild();f!==null?f.insertBefore(a):s.append(a),t.remove()}else if(pe(i)&&i.getListType()===e)c&&Uc(i,ms,c),i.append(a),t.remove();else{const f=Vt(e,e==="number"?Number(r[2]):void 0);c&&Uc(f,ms,c),f.append(a),t.replace(f)}a.append(...n),o||a.select(0,0);const u=(function(f){const d=f.match(/\t/g),h=f.match(/ /g);let g=0;return d&&(g+=d.length),h&&(g+=Math.floor(h.length/4)),g})(r[1]);u&&a.setIndent(u)},Uh=(e,t,n)=>{const r=[],o=e.getChildren();let i=0;for(const s of o)if(ke(s)){if(s.getChildrenSize()===1){const f=s.getFirstChild();if(pe(f)){r.push(Uh(f,t,n+1));continue}}const a=" ".repeat(4*n),l=e.getListType(),c=L1(e,ms),u=l==="number"?`${e.getStart()+i}. `:l==="check"?`${c} [${s.getChecked()?"x":" "}] `:c+" ";r.push(a+u+t(s)),i++}return r.join(`
55
- `)},gN={dependencies:[ic],export:(e,t)=>{if(!Rw(e))return null;const n=Number(e.getTag().slice(1));return"#".repeat(n)+" "+t(e)},regExp:tf,replace:jw(e=>{const t="h"+e[1].length;return go(t)}),type:"element"},pN={dependencies:[oc],export:(e,t)=>{if(!Jd(e))return null;const n=t(e).split(`
52
+ |(?![\\s\\S])))+`,"m"),alias:o,inside:{line:{pattern:/(.)(?=[\s\S]).*(?:\r\n?|\n)?/,lookbehind:!0},prefix:{pattern:/[\s\S]/,alias:/\w+/.exec(n)[0]}}}}),Object.defineProperty(e.languages.diff,"PREFIXES",{value:t})})(Prism);const tM=new Set(["http:","https:","mailto:","sms:","tel:"]);let da=class jw extends Tt{__url;__target;__rel;__title;static getType(){return"link"}static clone(t){return new jw(t.__url,{rel:t.__rel,target:t.__target,title:t.__title},t.__key)}constructor(t="",n={},r){super(r);const{target:o=null,rel:i=null,title:s=null}=n;this.__url=t,this.__target=o,this.__rel=i,this.__title=s}createDOM(t){const n=document.createElement("a");return this.updateLinkDOM(null,n,t),et(n,t.theme.link),n}updateLinkDOM(t,n,r){if(B1(n)){t&&t.__url===this.__url||(n.href=this.sanitizeUrl(this.__url));for(const o of["target","rel","title"]){const i=`__${o}`,s=this[i];t&&t[i]===s||(s?n[o]=s:n.removeAttribute(o))}}}updateDOM(t,n,r){return this.updateLinkDOM(t,n,r),!1}static importDOM(){return{a:t=>({conversion:nM,priority:1})}}static importJSON(t){return Ol().updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setURL(t.url).setRel(t.rel||null).setTarget(t.target||null).setTitle(t.title||null)}sanitizeUrl(t){t=zy(t);try{const n=new URL(zy(t));if(!tM.has(n.protocol))return"about:blank"}catch{return t}return t}exportJSON(){return{...super.exportJSON(),rel:this.getRel(),target:this.getTarget(),title:this.getTitle(),url:this.getURL()}}getURL(){return this.getLatest().__url}setURL(t){const n=this.getWritable();return n.__url=t,n}getTarget(){return this.getLatest().__target}setTarget(t){const n=this.getWritable();return n.__target=t,n}getRel(){return this.getLatest().__rel}setRel(t){const n=this.getWritable();return n.__rel=t,n}getTitle(){return this.getLatest().__title}setTitle(t){const n=this.getWritable();return n.__title=t,n}insertNewAfter(t,n=!0){const r=Ol(this.__url,{rel:this.__rel,target:this.__target,title:this.__title});return this.insertAfter(r,n),r}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(t,n,r){if(!W(n))return!1;const o=n.anchor.getNode(),i=n.focus.getNode();return this.isParentOf(o)&&this.isParentOf(i)&&n.getTextContent().length>0}isEmailURI(){return this.__url.startsWith("mailto:")}isWebSiteURI(){return this.__url.startsWith("https://")||this.__url.startsWith("http://")}};function nM(e){let t=null;if(B1(e)){const n=e.textContent;(n!==null&&n!==""||e.children.length>0)&&(t=Ol(e.getAttribute("href")||"",{rel:e.getAttribute("rel"),target:e.getAttribute("target"),title:e.getAttribute("title")}))}return{node:t}}function Ol(e="",t){return Et(new da(e,t))}function rM(e){return e instanceof da}class fa extends da{__isUnlinked;constructor(t="",n={},r){super(t,n,r),this.__isUnlinked=n.isUnlinked!==void 0&&n.isUnlinked!==null&&n.isUnlinked}static getType(){return"autolink"}static clone(t){return new fa(t.__url,{isUnlinked:t.__isUnlinked,rel:t.__rel,target:t.__target,title:t.__title},t.__key)}getIsUnlinked(){return this.__isUnlinked}setIsUnlinked(t){const n=this.getWritable();return n.__isUnlinked=t,n}createDOM(t){return this.__isUnlinked?document.createElement("span"):super.createDOM(t)}updateDOM(t,n,r){return super.updateDOM(t,n,r)||t.__isUnlinked!==this.__isUnlinked}static importJSON(t){return By().updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setIsUnlinked(t.isUnlinked||!1)}static importDOM(){return null}exportJSON(){return{...super.exportJSON(),isUnlinked:this.__isUnlinked}}insertNewAfter(t,n=!0){const r=this.getParentOrThrow().insertNewAfter(t,n);if(B(r)){const o=By(this.__url,{isUnlinked:this.__isUnlinked,rel:this.__rel,target:this.__target,title:this.__title});return r.append(o),o}return null}}function By(e="",t){return Et(new fa(e,t))}function oM(e){return e instanceof fa}const iM=/^\+?[0-9\s()-]{5,}$/;function zy(e){return e.match(/^[a-z][a-z0-9+.-]*:/i)||e.match(/^[/#.]/)?e:e.includes("@")?`mailto:${e}`:iM.test(e)?`tel:${e}`:`https://${e}`}function cf(e,t){const n={};for(const r of e){const o=t(r);o&&(n[o]?n[o].push(r):n[o]=[r])}return n}function Qh(e){const t=cf(e,n=>n.type);return{element:t.element||[],multilineElement:t["multiline-element"]||[],textFormat:t["text-format"]||[],textMatch:t["text-match"]||[]}}const Il=/[!-/:-@[-`{-~\s]/,sM=/^\s{0,3}$/;function uf(e){if(!Qr(e))return!1;const t=e.getFirstChild();return t==null||e.getChildrenSize()===1&&J(t)&&sM.test(t.getTextContent())}function aM(e,t,n,r){for(const o of t){if(!o.export)continue;const i=o.export(e,s=>Dl(s,n,r));if(i!=null)return i}return B(e)?Dl(e,n,r):Te(e)?e.getTextContent():null}function Dl(e,t,n,r,o){const i=[],s=e.getChildren();r||(r=[]),o||(o=[]);e:for(const a of s){for(const l of n){if(!l.export)continue;const c=l.export(a,u=>Dl(u,t,n,r,[...o,...r]),(u,f)=>Hy(u,f,t,r,o));if(c!=null){i.push(c);continue e}}Kn(a)?i.push(`
53
+ `):J(a)?i.push(Hy(a,a.getTextContent(),t,r,o)):B(a)?i.push(Dl(a,t,n,r,o)):Te(a)&&i.push(a.getTextContent())}return i.join("")}function Hy(e,t,n,r,o){let i=e.getFormat()===0?t:(function(d){return d.replace(/^\s+|\s+$/g,h=>[...h].map(g=>"&#"+g.codePointAt(0)+";").join(""))})(t);e.hasFormat("code")||(i=i.replace(/([*_`~\\])/g,"\\$1"));let s="",a="",l="";const c=Wy(e,!0),u=Wy(e,!1),f=new Set;for(const d of n){const h=d.format[0],g=d.tag;Da(e,h)&&!f.has(h)&&(f.add(h),Da(c,h)&&r.find(p=>p.tag===g)||(r.push({format:h,tag:g}),s+=g))}for(let d=0;d<r.length;d++){const h=Da(e,r[d].format),g=Da(u,r[d].format);if(h&&g)continue;const p=[...r];for(;p.length>d;){const m=p.pop();o&&m&&o.find(v=>v.tag===m.tag)||(m&&typeof m.tag=="string"&&(h?g||(l+=m.tag):a+=m.tag),r.pop())}break}return i=s+i+l,a+i}function Wy(e,t){let n=t?e.getPreviousSibling():e.getNextSibling();if(!n){const r=e.getParentOrThrow();r.isInline()&&(n=t?r.getPreviousSibling():r.getNextSibling())}for(;n;){if(B(n)){if(!n.isInline())break;const r=t?n.getLastDescendant():n.getFirstDescendant();if(J(r))return r;n=t?n.getPreviousSibling():n.getNextSibling()}if(J(n))return n;if(!B(n))return null}return null}function Da(e,t){return J(e)&&e.hasFormat(t)}function lM(e,t){const n=(function(o,i){const s=o.match(i.openTagsRegExp);if(s==null)return null;for(const a of s){const l=a.replace(/^\s/,""),c=i.fullMatchRegExpByTag[l];if(c==null)continue;const u=o.match(c),f=i.transformersByTag[l];if(u!=null&&f!=null){if(f.intraword!==!1)return u;const{index:d=0}=u,h=o[d-1],g=o[d+u[0].length];if((!h||Il.test(h))&&(!g||Il.test(g)))return u}}return null})(e.getTextContent(),t);if(!n)return null;const r=n.index||0;return{endIndex:r+n[0].length,match:n,startIndex:r,transformer:t.transformersByTag[n[1]]}}function ho(e){return J(e)&&!e.hasFormat("code")}function go(e,t,n){let r=lM(e,t),o=(function(s,a){const l=s;let c,u,f,d;for(const h of a){if(!h.replace||!h.importRegExp)continue;const g=l.getTextContent().match(h.importRegExp);if(!g)continue;const p=g.index||0,m=h.getEndIndex?h.getEndIndex(l,g):p+g[0].length;m!==!1&&(c===void 0||u===void 0||p<c&&(m>u||m<=c))&&(c=p,u=m,f=h,d=g)}return c===void 0||u===void 0||f===void 0||d===void 0?null:{endIndex:u,match:d,startIndex:c,transformer:f}})(e,n);if(r&&o&&(r.startIndex<=o.startIndex&&r.endIndex>=o.endIndex||o.startIndex>r.endIndex?o=null:r=null),r){const s=(function(a,l,c,u,f){const d=a.getTextContent();let h,g,p;if(f[0]===d?h=a:l===0?[h,g]=a.splitText(c):[p,h,g]=a.splitText(l,c),h.setTextContent(f[2]),u)for(const m of u.format)h.hasFormat(m)||h.toggleFormat(m);return{nodeAfter:g,nodeBefore:p,transformedNode:h}})(e,r.startIndex,r.endIndex,r.transformer,r.match);ho(s.nodeAfter)&&go(s.nodeAfter,t,n),ho(s.nodeBefore)&&go(s.nodeBefore,t,n),ho(s.transformedNode)&&go(s.transformedNode,t,n)}else if(o){const s=(function(a,l,c,u,f){let d,h,g;return l===0?[d,h]=a.splitText(c):[g,d,h]=a.splitText(l,c),u.replace?{nodeAfter:h,nodeBefore:g,transformedNode:u.replace(d,f)||void 0}:null})(e,o.startIndex,o.endIndex,o.transformer,o.match);if(!s)return;ho(s.nodeAfter)&&go(s.nodeAfter,t,n),ho(s.nodeBefore)&&go(s.nodeBefore,t,n),ho(s.transformedNode)&&go(s.transformedNode,t,n)}const i=e.getTextContent().replace(/\\([*_`~\\])/g,"$1").replace(/&#(\d+);/g,(s,a)=>String.fromCodePoint(a));e.setTextContent(i)}function cM(e,t=!1){const n=Qh(e),r=(function(o){const i={},s={},a=[],l="(?<![\\\\])";for(const c of o){const{tag:u}=c;i[u]=c;const f=u.replace(/(\*|\^|\+)/g,"\\$1");a.push(f),u.length===1?s[u]=u==="`"?new RegExp("(?<![\\\\`])(`)((?:\\\\`|[^`])+?)(`)(?!`)"):new RegExp(`(?<![\\\\${f}])(${f})((\\\\${f})?.*?[^${f}\\s](\\\\${f})?)((?<!\\\\)|(?<=\\\\\\\\))(${f})(?![\\\\${f}])`):s[u]=new RegExp(`(?<!\\\\)(${f})((\\\\${f})?.*?[^\\s](\\\\${f})?)((?<!\\\\)|(?<=\\\\\\\\))(${f})(?!\\\\)`)}return{fullMatchRegExpByTag:s,openTagsRegExp:new RegExp(`${l}(${a.join("|")})`,"g"),transformersByTag:i}})(n.textFormat);return(o,i)=>{const s=o.split(`
54
+ `),a=s.length,l=i||qe();l.clear();for(let u=0;u<a;u++){const f=s[u],[d,h]=uM(s,u,n.multilineElement,l);d?u=h:dM(f,l,n.element,r,n.textMatch,t)}const c=l.getChildren();for(const u of c)!t&&uf(u)&&l.getChildrenSize()>1&&u.remove();X()!==null&&l.selectStart()}}function uM(e,t,n,r){for(const o of n){const{handleImportAfterStartMatch:i,regExpEnd:s,regExpStart:a,replace:l}=o,c=e[t].match(a);if(!c)continue;if(i){const g=i({lines:e,rootNode:r,startLineIndex:t,startMatch:c,transformer:o});if(g===null)continue;if(g)return g}const u=typeof s=="object"&&"regExp"in s?s.regExp:s,f=s&&typeof s=="object"&&"optional"in s?s.optional:!s;let d=t;const h=e.length;for(;d<h;){const g=u?e[d].match(u):null;if(!g&&(!f||f&&d<h-1)){d++;continue}if(g&&t===d&&g.index===c.index){d++;continue}const p=[];if(g&&t===d)p.push(e[t].slice(c[0].length,-g[0].length));else for(let m=t;m<=d;m++)if(m===t){const v=e[m].slice(c[0].length);p.push(v)}else if(m===d&&g){const v=e[m].slice(0,-g[0].length);p.push(v)}else p.push(e[m]);if(l(r,null,c,g,p,!0)!==!1)return[!0,d];break}}return[!1,t]}function dM(e,t,n,r,o,i){const s=Fe(e),a=ve();a.append(s),t.append(a);for(const{regExp:l,replace:c}of n){const u=e.match(l);if(u&&(s.setTextContent(e.slice(u[0].length)),c(a,[s],u,!0)!==!1))break}if(go(s,r,o),a.isAttached()&&e.length>0){const l=a.getPreviousSibling();if(!i&&(Qr(l)||lf(l)||pe(l))){let c=l;if(pe(l)){const u=l.getLastDescendant();c=u==null?null:we(u,ke)}c!=null&&c.getTextContentSize()>0&&(c.splice(c.getChildrenSize(),0,[kn(),...a.getChildren()]),a.remove())}}}function fM(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const o of t)r.append("v",o);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const Vw=/^(\s*)(\d{1,})\.\s/,Bw=/^(\s*)[-*+]\s/,hM=/^(\s*)(?:[-*+]\s)?\s?(\[(\s|x)?\])\s/i,df=/^(#{1,6})\s/,zw=/^>\s/,Hw=/^[ \t]*```([\w-]+)?/,ff=/[ \t]*```$/,gM=/^[ \t]*```[^`]+(?:(?:`{1,2}|`{4,})[^`]+)*```(?:[^`]|$)/,pM=/^(?:\|)(.+)(?:\|)\s?$/,mM=/^(\| ?:?-*:? ?)+\|\s?$/,Ky=/^<[a-z_][\w-]*(?:\s[^<>]*)?\/?>/i,Uy=/^<\/[a-z_][\w-]*\s*>/i,Gy=e=>new RegExp(`(?:${e.source})$`,e.flags),_s=M3("mdListMarker",{parse:e=>typeof e=="string"&&/^[-*+]$/.test(e)?e:"-"}),Ww=e=>(t,n,r,o)=>{const i=e(r);i.append(...n),t.replace(i),o||i.select(0,0)},Kw=e=>(t,n,r,o)=>{const i=t.getPreviousSibling(),s=t.getNextSibling(),a=Zt(e==="check"?r[3]==="x":void 0),l=r[0].trim()[0],c=e!=="bullet"&&e!=="check"||l!==_s.parse(l)?void 0:l;if(pe(s)&&s.getListType()===e){c&&eu(s,_s,c);const f=s.getFirstChild();f!==null?f.insertBefore(a):s.append(a),t.remove()}else if(pe(i)&&i.getListType()===e)c&&eu(i,_s,c),i.append(a),t.remove();else{const f=Ht(e,e==="number"?Number(r[2]):void 0);c&&eu(f,_s,c),f.append(a),t.replace(f)}a.append(...n),o||a.select(0,0);const u=(function(f){const d=f.match(/\t/g),h=f.match(/ /g);let g=0;return d&&(g+=d.length),h&&(g+=Math.floor(h.length/4)),g})(r[1]);u&&a.setIndent(u)},eg=(e,t,n)=>{const r=[],o=e.getChildren();let i=0;for(const s of o)if(ke(s)){if(s.getChildrenSize()===1){const f=s.getFirstChild();if(pe(f)){r.push(eg(f,t,n+1));continue}}const a=" ".repeat(4*n),l=e.getListType(),c=Db(e,_s),u=l==="number"?`${e.getStart()+i}. `:l==="check"?`${c} [${s.getChecked()?"x":" "}] `:c+" ";r.push(a+u+t(s)),i++}return r.join(`
55
+ `)},yM={dependencies:[hc],export:(e,t)=>{if(!Pw(e))return null;const n=Number(e.getTag().slice(1));return"#".repeat(n)+" "+t(e)},regExp:df,replace:Ww(e=>{const t="h"+e[1].length;return wo(t)}),type:"element"},vM={dependencies:[fc],export:(e,t)=>{if(!lf(e))return null;const n=t(e).split(`
56
56
  `),r=[];for(const o of n)r.push("> "+o);return r.join(`
57
- `)},regExp:Iw,replace:(e,t,n,r)=>{if(r){const i=e.getPreviousSibling();if(Jd(i))return i.splice(i.getChildrenSize(),0,[Tn(),...t]),void e.remove()}const o=Hh();o.append(...t),e.replace(o),r||o.select(0,0)},type:"element"},mN={dependencies:[sc],export:e=>{if(!Wh(e))return null;const t=e.getTextContent();return"```"+(e.getLanguage()||"")+(t?`
58
- `+t:"")+"\n```"},regExpEnd:{optional:!0,regExp:nf},regExpStart:Dw,replace:(e,t,n,r,o,i)=>{let s,a;if(!t&&o){if(o.length===1)r?(s=ur(),a=n[1]+o[0]):(s=ur(n[1]),a=o[0].startsWith(" ")?o[0].slice(1):o[0]);else{if(s=ur(n[1]),o[0].trim().length===0)for(;o.length>0&&!o[0].length;)o.shift();else o[0]=o[0].startsWith(" ")?o[0].slice(1):o[0];for(;o.length>0&&!o[o.length-1].length;)o.pop();a=o.join(`
59
- `)}const l=Fe(a);s.append(l),e.append(s)}else t&&jw(l=>ur(l?l[1]:void 0))(e,t,n,i)},type:"multiline-element"},yN={dependencies:[jo,Xr],export:(e,t)=>pe(e)?Uh(e,t,0):null,regExp:Ow,replace:Vw("bullet"),type:"element"},vN={dependencies:[jo,Xr],export:(e,t)=>pe(e)?Uh(e,t,0):null,regExp:$w,replace:Vw("number"),type:"element"},xN={format:["code"],tag:"`",type:"text-format"},bN={format:["highlight"],tag:"==",type:"text-format"},wN={format:["bold","italic"],tag:"***",type:"text-format"},CN={format:["bold","italic"],intraword:!1,tag:"___",type:"text-format"},SN={format:["bold"],tag:"**",type:"text-format"},_N={format:["bold"],intraword:!1,tag:"__",type:"text-format"},TN={format:["strikethrough"],tag:"~~",type:"text-format"},EN={format:["italic"],tag:"*",type:"text-format"},RN={format:["italic"],intraword:!1,tag:"_",type:"text-format"},kN={dependencies:[ra],export:(e,t,n)=>{if(!eN(e)||tN(e))return null;const r=e.getTitle(),o=t(e);return r?`[${o}](${e.getURL()} "${r}")`:`[${o}](${e.getURL()})`},importRegExp:/(?:\[(.+?)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))/,regExp:/(?:\[(.+?)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))$/,replace:(e,t)=>{const[,n,r,o]=t,i=kl(r,{title:o}),s=n.split("[").length-1,a=n.split("]").length-1;let l=n,c="";if(s<a)return;if(s>a){const f=n.split("[");c="["+f[0],l=f.slice(1).join("[")}const u=Fe(l);return u.setFormat(e.getFormat()),i.append(u),e.replace(i),c&&i.insertBefore(Fe(c)),u},trigger:")",type:"text-match"},AN=[gN,pN,yN,vN],MN=[mN],NN=[xN,wN,CN,SN,_N,bN,EN,RN,TN],PN=[kN],ia=[...AN,...MN,...NN,...PN];function Ky(e,t,n){const r=n.length;for(let o=t;o>=r;o--){const i=o-r;if(Bw(e,i,n,0,r)&&e[i+r]!==" ")return i}return-1}function Bw(e,t,n,r,o){for(let i=0;i<o;i++)if(e[t+i]!==n[r+i])return!1;return!0}function LN(e,t=ia){const n=Kh(t),r=Qd(n.textFormat,({tag:s})=>s[s.length-1]),o=Qd(n.textMatch,({trigger:s})=>s);for(const s of t){const a=s.type;if(a==="element"||a==="text-match"||a==="multiline-element"){const l=s.dependencies;for(const c of l)e.hasNode(c)||cN(173,c.getType())}}const i=(s,a,l)=>{(function(c,u,f,d){const h=c.getParent();if(!pt(h)||c.getFirstChild()!==u)return!1;const g=u.getTextContent();if(g[f-1]!==" ")return!1;for(const{regExp:p,replace:m}of d){const x=g.match(p);if(x&&x[0].length===(x[0].endsWith(" ")?f:f-1)){const y=u.getNextSiblings(),[v,b]=u.splitText(f);if(m(c,b?[b,...y]:y,x,!1)!==!1)return v.remove(),!0}}return!1})(s,a,l,n.element)||(function(c,u,f,d){const h=c.getParent();if(!pt(h)||c.getFirstChild()!==u)return!1;const g=u.getTextContent();if(g[f-1]!==" ")return!1;for(const{regExpStart:p,replace:m,regExpEnd:x}of d){if(x&&!("optional"in x)||x&&"optional"in x&&!x.optional)continue;const y=g.match(p);if(y&&y[0].length===(y[0].endsWith(" ")?f:f-1)){const v=u.getNextSiblings(),[b,w]=u.splitText(f);if(m(c,w?[w,...v]:v,y,null,null,!1)!==!1)return b.remove(),!0}}return!1})(s,a,l,n.multilineElement)||(function(c,u,f){let d=c.getTextContent();const h=f[d[u-1]];if(h==null)return!1;u<d.length&&(d=d.slice(0,u));for(const g of h){if(!g.replace||!g.regExp)continue;const p=d.match(g.regExp);if(p===null)continue;const m=p.index||0,x=m+p[0].length;let y;return m===0?[y]=c.splitText(x):[,y]=c.splitText(m,x),y.selectNext(0,0),g.replace(y,p),!0}return!1})(a,l,o)||(function(c,u,f){const d=c.getTextContent(),h=u-1,g=d[h],p=f[g];if(!p)return!1;for(const m of p){const{tag:x}=m,y=x.length,v=h-y+1;if(y>1&&!Bw(d,v,x,0,y)||d[v-1]===" ")continue;const b=d[h+1];if(m.intraword===!1&&b&&!Al.test(b))continue;const w=c;let _=w,E=Ky(d,v,x),T=_;for(;E<0&&(T=T.getPreviousSibling())&&!zn(T);)if(X(T)){if(T.hasFormat("code"))continue;const L=T.getTextContent();_=T,E=Ky(L,L.length,x)}if(E<0||_===w&&E+y===v)continue;const k=_.getTextContent();if(E>0&&k[E-1]===g)continue;const P=k[E-1];if(m.intraword===!1&&P&&!Al.test(P))continue;const O=w.getTextContent(),D=O.slice(0,v)+O.slice(h+1);w.setTextContent(D);const I=_===w?D:k;_.setTextContent(I.slice(0,E)+I.slice(E+y));const $=Y(),H=Zl();Ge(H);const U=h-y*(_===w?2:1)+1;H.anchor.set(_.__key,E,"text"),H.focus.set(w.__key,U,"text");for(const L of m.format)H.hasFormat(L)||H.formatText(L);H.anchor.set(H.focus.key,H.focus.offset,H.focus.type);for(const L of m.format)H.hasFormat(L)&&H.toggleFormat(L);return W($)&&(H.format=$.format),!0}})(a,l,r)};return e.registerUpdateListener(({tags:s,dirtyLeaves:a,editorState:l,prevEditorState:c})=>{if(s.has(lb)||s.has(q3)||e.isComposing())return;const u=l.read(Y),f=c.read(Y);if(!W(f)||!W(u)||!u.isCollapsed()||u.is(f))return;const d=u.anchor.key,h=u.anchor.offset,g=l._nodeMap.get(d);!X(g)||!a.has(d)||h!==1&&h>f.anchor.offset+1||e.update(()=>{if(!so(g))return;const p=g.getParent();p===null||Wh(p)||i(p,g,u.anchor.offset)})})}function zw(e,t=ia,n,r=!1,o=!1){const i=r?e:(function(s,a=!1){const l=s.split(`
60
- `);let c=!1;const u=[];for(let f=0;f<l.length;f++){const d=l[f].trimEnd(),h=u[u.length-1];dN.test(d)?u.push(d):Dw.test(d)||nf.test(d)?(c=!c,u.push(d)):c||d===""||h===""||!h||tf.test(h)||tf.test(d)||Iw.test(d)||$w.test(d)||Ow.test(d)||uN.test(d)||fN.test(d)||hN.test(d)||!a||zy.test(d)||Hy.test(d)||Wy(Hy).test(h)||Wy(zy).test(h)||nf.test(h)?u.push(d):u[u.length-1]=h+" "+d.trimStart()}return u.join(`
61
- `)})(e,o);return sN(t,r)(i,n)}function FN(e=ia,t,n=!1){return(function(o,i=!1){const s=Kh(o),a=[...s.multilineElement,...s.element],l=!i,c=s.textFormat.filter(u=>u.format.length===1).sort((u,f)=>Number(u.format.includes("code"))-Number(f.format.includes("code")));return u=>{const f=[],d=(u||qe()).getChildren();for(let h=0;h<d.length;h++){const g=d[h],p=oN(g,a,c,s.textMatch);p!=null&&f.push(l&&h>0&&!ef(g)&&!ef(d[h-1])?`
57
+ `)},regExp:zw,replace:(e,t,n,r)=>{if(r){const i=e.getPreviousSibling();if(lf(i))return i.splice(i.getChildrenSize(),0,[kn(),...t]),void e.remove()}const o=Zh();o.append(...t),e.replace(o),r||o.select(0,0)},type:"element"},xM={dependencies:[gc],export:e=>{if(!Jh(e))return null;const t=e.getTextContent();return"```"+(e.getLanguage()||"")+(t?`
58
+ `+t:"")+"\n```"},regExpEnd:{optional:!0,regExp:ff},regExpStart:Hw,replace:(e,t,n,r,o,i)=>{let s,a;if(!t&&o){if(o.length===1)r?(s=hr(),a=n[1]+o[0]):(s=hr(n[1]),a=o[0].startsWith(" ")?o[0].slice(1):o[0]);else{if(s=hr(n[1]),o[0].trim().length===0)for(;o.length>0&&!o[0].length;)o.shift();else o[0]=o[0].startsWith(" ")?o[0].slice(1):o[0];for(;o.length>0&&!o[o.length-1].length;)o.pop();a=o.join(`
59
+ `)}const l=Fe(a);s.append(l),e.append(s)}else t&&Ww(l=>hr(l?l[1]:void 0))(e,t,n,i)},type:"multiline-element"},bM={dependencies:[Uo,eo],export:(e,t)=>pe(e)?eg(e,t,0):null,regExp:Bw,replace:Kw("bullet"),type:"element"},wM={dependencies:[Uo,eo],export:(e,t)=>pe(e)?eg(e,t,0):null,regExp:Vw,replace:Kw("number"),type:"element"},CM={format:["code"],tag:"`",type:"text-format"},SM={format:["highlight"],tag:"==",type:"text-format"},_M={format:["bold","italic"],tag:"***",type:"text-format"},TM={format:["bold","italic"],intraword:!1,tag:"___",type:"text-format"},EM={format:["bold"],tag:"**",type:"text-format"},RM={format:["bold"],intraword:!1,tag:"__",type:"text-format"},kM={format:["strikethrough"],tag:"~~",type:"text-format"},AM={format:["italic"],tag:"*",type:"text-format"},NM={format:["italic"],intraword:!1,tag:"_",type:"text-format"},MM={dependencies:[da],export:(e,t,n)=>{if(!rM(e)||oM(e))return null;const r=e.getTitle(),o=t(e);return r?`[${o}](${e.getURL()} "${r}")`:`[${o}](${e.getURL()})`},importRegExp:/(?:\[(.+?)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))/,regExp:/(?:\[(.+?)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))$/,replace:(e,t)=>{const[,n,r,o]=t,i=Ol(r,{title:o}),s=n.split("[").length-1,a=n.split("]").length-1;let l=n,c="";if(s<a)return;if(s>a){const f=n.split("[");c="["+f[0],l=f.slice(1).join("[")}const u=Fe(l);return u.setFormat(e.getFormat()),i.append(u),e.replace(i),c&&i.insertBefore(Fe(c)),u},trigger:")",type:"text-match"},PM=[yM,vM,bM,wM],LM=[xM],FM=[CM,_M,TM,EM,RM,SM,AM,NM,kM],$M=[MM],ha=[...PM,...LM,...FM,...$M];function qy(e,t,n){const r=n.length;for(let o=t;o>=r;o--){const i=o-r;if(Uw(e,i,n,0,r)&&e[i+r]!==" ")return i}return-1}function Uw(e,t,n,r,o){for(let i=0;i<o;i++)if(e[t+i]!==n[r+i])return!1;return!0}function OM(e,t=ha){const n=Qh(t),r=cf(n.textFormat,({tag:s})=>s[s.length-1]),o=cf(n.textMatch,({trigger:s})=>s);for(const s of t){const a=s.type;if(a==="element"||a==="text-match"||a==="multiline-element"){const l=s.dependencies;for(const c of l)e.hasNode(c)||fM(173,c.getType())}}const i=(s,a,l)=>{(function(c,u,f,d){const h=c.getParent();if(!vt(h)||c.getFirstChild()!==u)return!1;const g=u.getTextContent();if(g[f-1]!==" ")return!1;for(const{regExp:p,replace:m}of d){const v=g.match(p);if(v&&v[0].length===(v[0].endsWith(" ")?f:f-1)){const y=u.getNextSiblings(),[x,b]=u.splitText(f);if(m(c,b?[b,...y]:y,v,!1)!==!1)return x.remove(),!0}}return!1})(s,a,l,n.element)||(function(c,u,f,d){const h=c.getParent();if(!vt(h)||c.getFirstChild()!==u)return!1;const g=u.getTextContent();if(g[f-1]!==" ")return!1;for(const{regExpStart:p,replace:m,regExpEnd:v}of d){if(v&&!("optional"in v)||v&&"optional"in v&&!v.optional)continue;const y=g.match(p);if(y&&y[0].length===(y[0].endsWith(" ")?f:f-1)){const x=u.getNextSiblings(),[b,w]=u.splitText(f);if(m(c,w?[w,...x]:x,y,null,null,!1)!==!1)return b.remove(),!0}}return!1})(s,a,l,n.multilineElement)||(function(c,u,f){let d=c.getTextContent();const h=f[d[u-1]];if(h==null)return!1;u<d.length&&(d=d.slice(0,u));for(const g of h){if(!g.replace||!g.regExp)continue;const p=d.match(g.regExp);if(p===null)continue;const m=p.index||0,v=m+p[0].length;let y;return m===0?[y]=c.splitText(v):[,y]=c.splitText(m,v),y.selectNext(0,0),g.replace(y,p),!0}return!1})(a,l,o)||(function(c,u,f){const d=c.getTextContent(),h=u-1,g=d[h],p=f[g];if(!p)return!1;for(const m of p){const{tag:v}=m,y=v.length,x=h-y+1;if(y>1&&!Uw(d,x,v,0,y)||d[x-1]===" ")continue;const b=d[h+1];if(m.intraword===!1&&b&&!Il.test(b))continue;const w=c;let _=w,E=qy(d,x,v),R=_;for(;E<0&&(R=R.getPreviousSibling())&&!Kn(R);)if(J(R)){if(R.hasFormat("code"))continue;const O=R.getTextContent();_=R,E=qy(O,O.length,v)}if(E<0||_===w&&E+y===x)continue;const k=_.getTextContent();if(E>0&&k[E-1]===g)continue;const M=k[E-1];if(m.intraword===!1&&M&&!Il.test(M))continue;const F=w.getTextContent(),D=F.slice(0,x)+F.slice(h+1);w.setTextContent(D);const j=_===w?D:k;_.setTextContent(j.slice(0,E)+j.slice(E+y));const I=X(),$=ic();Ge($);const H=h-y*(_===w?2:1)+1;$.anchor.set(_.__key,E,"text"),$.focus.set(w.__key,H,"text");for(const O of m.format)$.hasFormat(O)||$.formatText(O);$.anchor.set($.focus.key,$.focus.offset,$.focus.type);for(const O of m.format)$.hasFormat(O)&&$.toggleFormat(O);return W(I)&&($.format=I.format),!0}})(a,l,r)};return e.registerUpdateListener(({tags:s,dirtyLeaves:a,editorState:l,prevEditorState:c})=>{if(s.has(h1)||s.has(Z3)||e.isComposing())return;const u=l.read(X),f=c.read(X);if(!W(f)||!W(u)||!u.isCollapsed()||u.is(f))return;const d=u.anchor.key,h=u.anchor.offset,g=l._nodeMap.get(d);!J(g)||!a.has(d)||h!==1&&h>f.anchor.offset+1||e.update(()=>{if(!ho(g))return;const p=g.getParent();p===null||Jh(p)||i(p,g,u.anchor.offset)})})}function Gw(e,t=ha,n,r=!1,o=!1){const i=r?e:(function(s,a=!1){const l=s.split(`
60
+ `);let c=!1;const u=[];for(let f=0;f<l.length;f++){const d=l[f].trimEnd(),h=u[u.length-1];gM.test(d)?u.push(d):Hw.test(d)||ff.test(d)?(c=!c,u.push(d)):c||d===""||h===""||!h||df.test(h)||df.test(d)||zw.test(d)||Vw.test(d)||Bw.test(d)||hM.test(d)||pM.test(d)||mM.test(d)||!a||Ky.test(d)||Uy.test(d)||Gy(Uy).test(h)||Gy(Ky).test(h)||ff.test(h)?u.push(d):u[u.length-1]=h+" "+d.trimStart()}return u.join(`
61
+ `)})(e,o);return cM(t,r)(i,n)}function IM(e=ha,t,n=!1){return(function(o,i=!1){const s=Qh(o),a=[...s.multilineElement,...s.element],l=!i,c=s.textFormat.filter(u=>u.format.length===1).sort((u,f)=>Number(u.format.includes("code"))-Number(f.format.includes("code")));return u=>{const f=[],d=(u||qe()).getChildren();for(let h=0;h<d.length;h++){const g=d[h],p=aM(g,a,c,s.textMatch);p!=null&&f.push(l&&h>0&&!uf(g)&&!uf(d[h-1])?`
62
62
  `.concat(p):p)}return f.join(`
63
- `)}})(e,n)(t)}function $N({defaultSelection:e}){const[t]=it();return S.useEffect(()=>{t.focus(()=>{const n=document.activeElement,r=t.getRootElement();r===null||n!==null&&r.contains(n)||r.focus({preventScroll:!0})},{defaultSelection:e})},[e,t]),null}const Hw=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,ON=Hw?S.useLayoutEffect:S.useEffect,Na={tag:yi};function Ww({initialConfig:e,children:t}){const n=S.useMemo(()=>{const{theme:r,namespace:o,nodes:i,onError:s,editorState:a,html:l}=e,c=s3(null,r),u=wb({editable:e.editable,html:l,namespace:o,nodes:i,onError:f=>s(f,u),theme:r});return(function(f,d){if(d!==null){if(d===void 0)f.update(()=>{const h=qe();if(h.isEmpty()){const g=ye();h.append(g);const p=Hw?document.activeElement:null;(Y()!==null||p!==null&&p===f.getRootElement())&&g.select()}},Na);else if(d!==null)switch(typeof d){case"string":{const h=f.parseEditorState(d);f.setEditorState(h,Na);break}case"object":f.setEditorState(d,Na);break;case"function":f.update(()=>{qe().isEmpty()&&d(f)},Na)}}})(u,a),[u,c]},[]);return ON(()=>{const r=e.editable,[o]=n;o.setEditable(r===void 0||r)},[]),C.jsx(_1.Provider,{value:n,children:t})}function IN(){return qe().getTextContent()}function DN(e,t=!0){if(e)return!1;let n=IN();return t&&(n=n.trim()),n===""}function jN(e){if(!DN(e,!1))return!1;const t=qe().getChildren(),n=t.length;if(n>1)return!1;for(let r=0;r<n;r++){const o=t[r];if(_e(o))return!1;if(B(o)){if(!Yr(o)||o.__indent!==0)return!1;const i=o.getChildren(),s=i.length;for(let a=0;a<s;a++){const l=i[r];if(!X(l))return!1}}}return!0}function Kw(e){return()=>jN(e)}function VN(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const o of t)r.append("v",o);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function BN(e,t,n,r){const o=s=>s instanceof n,i=s=>{const a=Fe(s.getTextContent());a.setFormat(s.getFormat()),s.replace(a)};return[e.registerNodeTransform(un,s=>{if(!s.isSimpleText())return;let a,l=s.getPreviousSibling(),c=s.getTextContent(),u=s;if(X(l)){const d=l.getTextContent(),h=t(d+c);if(o(l)){if(h===null||(g=>g.getLatest().__mode)(l)!==0)return void i(l);{const g=h.end-d.length;if(g>0){const p=d+c.slice(0,g);if(l.select(),l.setTextContent(p),g===c.length)s.remove();else{const m=c.slice(g);s.setTextContent(m)}return}}}else if(h===null||h.start<d.length)return}let f=0;for(;;){a=t(c);let d,h=a===null?"":c.slice(a.end);if(c=h,h===""){const p=u.getNextSibling();if(X(p)){h=u.getTextContent()+p.getTextContent();const m=t(h);if(m===null)return void(o(p)?i(p):p.markDirty());if(m.start!==0)return}}if(a===null)return;if(a.start===0&&X(l)&&l.isTextEntity()){f+=a.end;continue}a.start===0?[d,u]=u.splitText(a.end):[,d,u]=u.splitText(a.start+f,a.end+f),d===void 0&&VN(165,"nodeToReplace");const g=r(d);if(g.setFormat(d.getFormat()),d.replace(g),u==null)return;f=0,l=g}}),e.registerNodeTransform(n,s=>{const a=s.getTextContent(),l=t(a);if(l===null||l.start!==0)return void i(s);if(a.length>l.end)return void s.splitText(l.end);const c=s.getPreviousSibling();X(c)&&c.isTextEntity()&&(i(c),i(s));const u=s.getNextSibling();X(u)&&u.isTextEntity()&&(i(u),o(s)&&i(s))})]}let ac=class Uw extends un{static getType(){return"hashtag"}static clone(t){return new Uw(t.__text,t.__key)}createDOM(t){const n=super.createDOM(t);return Qe(n,t.theme.hashtag),n}static importJSON(t){return Gw().updateFromJSON(t)}canInsertTextBefore(){return!1}isTextEntity(){return!0}};function Gw(e=""){return _t(new ac(e))}const zN=new RegExp((function(){const{alpha:e,alphanumeric:t,hashChars:n}=(function(){const o=String.fromCharCode,i="A-Za-zªµºÀ-ÖØ-öø-Ɂɐ-ˁˆ-ˑˠ-ˤˮͺΆΈ-ΊΌΎ-ΡΣ-ώϐ-ϵϷ-ҁҊ-ӎӐ-ӹԀ-ԏԱ-Ֆՙա-ևא-תװ-ײء-غـ-يٮ-ٯٱ-ۓەۥ-ۦۮ-ۯۺ-ۼۿܐܒ-ܯݍ-ݭހ-ޥޱऄ-हऽॐक़-ॡॽঅ-ঌএ-ঐও-নপ-রলশ-হঽৎড়-ঢ়য়-ৡৰ-ৱਅ-ਊਏ-ਐਓ-ਨਪ-ਰਲ-ਲ਼ਵ-ਸ਼ਸ-ਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલ-ળવ-હઽૐૠ-ૡଅ-ଌଏ-ଐଓ-ନପ-ରଲ-ଳଵ-ହଽଡ଼-ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கங-சஜஞ-டண-தந-பம-ஹఅ-ఌఎ-ఐఒ-నప-ళవ-హౠ-ౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠ-ೡഅ-ഌഎ-ഐഒ-നപ-ഹൠ-ൡඅ-ඖක-නඳ-රලව-ෆก-ะา-ำเ-ๆກ-ຂຄງ-ຈຊຍດ-ທນ-ຟມ-ຣລວສ-ຫອ-ະາ-ຳຽເ-ໄໆໜ-ໝༀཀ-ཇཉ-ཪྈ-ྋက-အဣ-ဧဩ-ဪၐ-ၕႠ-Ⴥა-ჺჼᄀ-ᅙᅟ-ᆢᆨ-ᇹሀ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙶᚁ-ᚚᚠ-ᛪᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᤀ-ᤜᥐ-ᥭᥰ-ᥴᦀ-ᦩᧁ-ᧇᨀ-ᨖᴀ-ᶿḀ-ẛẠ-ỹἀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₔℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℱℳ-ℹℼ-ℿⅅ-ⅉⰀ-Ⱞⰰ-ⱞⲀ-ⳤⴀ-ⴥⴰ-ⵥⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〆〱-〵〻-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄬㄱ-ㆎㆠ-ㆷㇰ-ㇿ㐀-䶵一-龻ꀀ-ꒌꠀ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢ가-힣豈-鶴侮-頻並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּ-סּףּ-פּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵÀ-ÖØ-öø-ÿĀ-ɏɓ-ɔɖ-ɗəɛɣɨɯɲʉʋʻ̀-ͯḀ-ỿЀ-ӿԀ-ԧⷠ-ⷿꙀ-֑ꚟ-ֿׁ-ׂׄ-ׇׅא-תװ-״﬒-ﬨשׁ-זּטּ-לּמּנּ-סּףּ-פּצּ-ﭏؐ-ؚؠ-ٟٮ-ۓە-ۜ۞-۪ۨ-ۯۺ-ۼۿݐ-ݿࢠࢢ-ࢬࣤ-ࣾﭐ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼ‌-‌ก-ฺเ-๎ᄀ-ᇿ㄰-ㆅꥠ-꥿가-힯ힰ-퟿ᄀ-ᅵァ-ヺー-ヾヲ-゚0-9A-Za-zぁ-ゖ゙-ゞ㐀-䶿一-鿿"+o(173824)+"-"+o(177983)+o(177984)+"-"+o(178207)+o(194560)+"-"+o(195103)+"〃々〻";return{alpha:i,alphanumeric:i+"̀-ͯ҃-֑҆-ֹֻ-ֽֿׁ-ׂׄ-ׇׅؐ-ًؕ-ٰٞۖ-ۜ۟-ۤۧ-۪ۨ-ܑۭܰ-݊ަ-ްँ-ः़ा-्॑-॔ॢ-ॣঁ-ঃ়া-ৄে-ৈো-্ৗৢ-ৣਁ-ਃ਼ਾ-ੂੇ-ੈੋ-੍ੰ-ੱઁ-ઃ઼ા-ૅે-ૉો-્ૢ-ૣଁ-ଃ଼ା-ୃେ-ୈୋ-୍ୖ-ୗஂா-ூெ-ைொ-்ௗఁ-ఃా-ౄె-ైొ-్ౕ-ౖಂ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕ-ೖം-ഃാ-ൃെ-ൈൊ-്ൗං-ඃ්ා-ුූෘ-ෟෲ-ෳัิ-ฺ็-๎ັິ-ູົ-ຼ່-ໍ༘-༹༙༵༷༾-༿ཱ-྄྆-྇ྐ-ྗྙ-ྼ࿆ာ-ဲံ-္ၖ-ၙ፟ᜒ-᜔ᜲ-᜴ᝒ-ᝓᝲ-ᝳា-៓៝᠋-᠍ᢩᤠ-ᤫᤰ-᤻ᦰ-ᧀᧈ-ᧉᨗ-ᨛ᷀-᷃⃐-⃥⃜⃡-⃫〪-゙〯-゚ꠂ꠆ꠋꠣ-ꠧﬞ︀-️︠-︣0-9٠-٩۰-۹०-९০-৯੦-੯૦-૯୦-୯௦-௯౦-౯೦-೯൦-൯๐-๙໐-໙༠-༩၀-၉០-៩᠐-᠙᥆-᥏᧐-᧙0-9_",hashChars:"#\\uFF03"}})(),r="["+t+"]";return"("+("^|$|[^&/"+t+"]")+")("+("["+n+"]")+")("+r+"*"+("["+e+"]")+r+"*)"})(),"i"),HN={getHashtagMatch:function(e){const t=zN.exec(e);if(t===null)return null;const n=t[3].length+1,r=t.index+t[1].length;return{end:r+n,start:r}}};function WN(e,t=HN){return Rn(...BN(e,t.getHashtagMatch,ac,n=>Gw(n.getTextContent())))}function KN(){const[e]=it();return S.useEffect(()=>{if(!e.hasNodes([ac]))throw new Error("HashtagPlugin: HashtagNode not registered on editor");return WN(e)},[e]),null}function UN({hasStrictIndent:e=!1}){const[t]=it();return S.useEffect(()=>{if(!t.hasNodes([jo,Xr]))throw new Error("ListPlugin: ListNode and/or ListItemNode not registered on editor")},[t]),S.useEffect(()=>{if(e)return _M(t)},[t,e]),(function(n){S.useEffect(()=>SM(n),[n])})(t),null}function Uy(e,t){return e.getEditorState().read(()=>{const n=Le(t);return n!==null&&n.isSelected()})}function GN(e){const[t]=it(),[n,r]=S.useState(()=>Uy(t,e));return S.useEffect(()=>{let o=!0;const i=t.registerUpdateListener(()=>{o&&r(Uy(t,e))});return()=>{o=!1,i()}},[t,e]),[n,S.useCallback(o=>{t.update(()=>{let i=Y();bt(i)||(i=vh(),Ge(i)),bt(i)&&(o?i.add(e):i.delete(e))})},[t,e]),S.useCallback(()=>{t.update(()=>{const o=Y();bt(o)&&o.clear()})},[t])]}function qN({nodeKey:e}){const[t]=it(),[n,r,o]=GN(e);return S.useEffect(()=>Rn(t.registerCommand(Kl,i=>{const s=t.getElementByKey(e);return i.target===s&&(i.shiftKey||o(),r(!n),!0)},ar)),[o,t,n,e,r]),S.useEffect(()=>{const i=t.getElementByKey(e),s=t._config.theme.hrSelected??"selected";i!==null&&(n?Qe(i,s):Un(i,s))},[t,n,e]),null}let qw=class Yw extends Bh{static getType(){return"horizontalrule"}static clone(t){return new Yw(t.__key)}static importJSON(t){return Gh().updateFromJSON(t)}static importDOM(){return{hr:()=>({conversion:YN,priority:0})}}decorate(){return C.jsx(qN,{nodeKey:this.__key})}};function YN(){return{node:Gh()}}function Gh(){return _t(new qw)}const XN=[{dependencies:[qw],export:e=>hM(e)?"***":null,regExp:/^(---|\*\*\*|___)\s?$/,replace:(e,t,n,r)=>{const o=Gh();r||e.getNextSibling()!=null?e.replace(o):e.insertBefore(o),o.selectNext()},type:"element"},...ia];function ZN({transformers:e=XN}){const[t]=it();return S.useEffect(()=>LN(t,e),[t,e]),null}const JN=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?S.useLayoutEffect:S.useEffect;function QN({ignoreHistoryMergeTagChange:e=!0,ignoreSelectionChange:t=!1,onChange:n}){const[r]=it();return JN(()=>{if(n)return r.registerUpdateListener(({editorState:o,dirtyElements:i,dirtyLeaves:s,prevEditorState:a,tags:l})=>{t&&i.size===0&&s.size===0||e&&l.has(yi)||a.isEmpty()||n(o,r,l)})},[r,e,t,n]),null}const qh=/^(\d+(?:\.\d+)?)px$/,rt={BOTH:3,COLUMN:2,NO_STATUS:0,ROW:1};class kn extends St{__colSpan;__rowSpan;__headerState;__width;__backgroundColor;__verticalAlign;static getType(){return"tablecell"}static clone(t){return new kn(t.__headerState,t.__colSpan,t.__width,t.__key)}afterCloneFrom(t){super.afterCloneFrom(t),this.__rowSpan=t.__rowSpan,this.__backgroundColor=t.__backgroundColor,this.__verticalAlign=t.__verticalAlign}static importDOM(){return{td:t=>({conversion:Gy,priority:0}),th:t=>({conversion:Gy,priority:0})}}static importJSON(t){return ln().updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setHeaderStyles(t.headerState).setColSpan(t.colSpan||1).setRowSpan(t.rowSpan||1).setWidth(t.width||void 0).setBackgroundColor(t.backgroundColor||null).setVerticalAlign(t.verticalAlign||void 0)}constructor(t=rt.NO_STATUS,n=1,r,o){super(o),this.__colSpan=n,this.__rowSpan=1,this.__headerState=t,this.__width=r,this.__backgroundColor=null,this.__verticalAlign=void 0}createDOM(t){const n=document.createElement(this.getTag());return this.__width&&(n.style.width=`${this.__width}px`),this.__colSpan>1&&(n.colSpan=this.__colSpan),this.__rowSpan>1&&(n.rowSpan=this.__rowSpan),this.__backgroundColor!==null&&(n.style.backgroundColor=this.__backgroundColor),rf(this.__verticalAlign)&&(n.style.verticalAlign=this.__verticalAlign),Qe(n,t.theme.tableCell,this.hasHeader()&&t.theme.tableCellHeader),n}exportDOM(t){const n=super.exportDOM(t);if(Be(n.element)){const r=n.element;r.setAttribute("data-temporary-table-cell-lexical-key",this.getKey()),r.style.border="1px solid black",this.__colSpan>1&&(r.colSpan=this.__colSpan),this.__rowSpan>1&&(r.rowSpan=this.__rowSpan),r.style.width=`${this.getWidth()||75}px`,r.style.verticalAlign=this.getVerticalAlign()||"top",r.style.textAlign="start",this.__backgroundColor===null&&this.hasHeader()&&(r.style.backgroundColor="#f2f3f5")}return n}exportJSON(){return{...super.exportJSON(),...rf(this.__verticalAlign)&&{verticalAlign:this.__verticalAlign},backgroundColor:this.getBackgroundColor(),colSpan:this.__colSpan,headerState:this.__headerState,rowSpan:this.__rowSpan,width:this.getWidth()}}getColSpan(){return this.getLatest().__colSpan}setColSpan(t){const n=this.getWritable();return n.__colSpan=t,n}getRowSpan(){return this.getLatest().__rowSpan}setRowSpan(t){const n=this.getWritable();return n.__rowSpan=t,n}getTag(){return this.hasHeader()?"th":"td"}setHeaderStyles(t,n=rt.BOTH){const r=this.getWritable();return r.__headerState=t&n|r.__headerState&~n,r}getHeaderStyles(){return this.getLatest().__headerState}setWidth(t){const n=this.getWritable();return n.__width=t,n}getWidth(){return this.getLatest().__width}getBackgroundColor(){return this.getLatest().__backgroundColor}setBackgroundColor(t){const n=this.getWritable();return n.__backgroundColor=t,n}getVerticalAlign(){return this.getLatest().__verticalAlign}setVerticalAlign(t){const n=this.getWritable();return n.__verticalAlign=t||void 0,n}toggleHeaderStyle(t){const n=this.getWritable();return(n.__headerState&t)===t?n.__headerState-=t:n.__headerState+=t,n}hasHeaderState(t){return(this.getHeaderStyles()&t)===t}hasHeader(){return this.getLatest().__headerState!==rt.NO_STATUS}updateDOM(t){return t.__headerState!==this.__headerState||t.__width!==this.__width||t.__colSpan!==this.__colSpan||t.__rowSpan!==this.__rowSpan||t.__backgroundColor!==this.__backgroundColor||t.__verticalAlign!==this.__verticalAlign}isShadowRoot(){return!0}collapseAtStart(){return!0}canBeEmpty(){return!1}canIndent(){return!1}}function rf(e){return e==="middle"||e==="bottom"}function Gy(e){const t=e,n=e.nodeName.toLowerCase();let r;qh.test(t.style.width)&&(r=parseFloat(t.style.width));const o=ln(n==="th"?rt.ROW:rt.NO_STATUS,t.colSpan,r);o.__rowSpan=t.rowSpan;const i=t.style.backgroundColor;i!==""&&(o.__backgroundColor=i);const s=t.style.verticalAlign;rf(s)&&(o.__verticalAlign=s);const a=t.style,l=(a&&a.textDecoration||"").split(" "),c=a.fontWeight==="700"||a.fontWeight==="bold",u=l.includes("line-through"),f=a.fontStyle==="italic",d=l.includes("underline");return{after:h=>{const g=[];let p=null;const m=()=>{if(p){const x=p.getFirstChild();zn(x)&&p.getChildrenSize()===1&&x.remove()}};for(const x of h)CA(x)||X(x)||zn(x)?(X(x)&&(c&&x.toggleFormat("bold"),u&&x.toggleFormat("strikethrough"),f&&x.toggleFormat("italic"),d&&x.toggleFormat("underline")),p?p.append(x):(p=ye().append(x),g.push(p))):(g.push(x),m(),p=null);return m(),g.length===0&&g.push(ye()),g},node:o}}function ln(e=rt.NO_STATUS,t=1,n){return _t(new kn(e,t,n))}function ge(e){return e instanceof kn}const Xw=le("INSERT_TABLE_COMMAND");function de(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const o of t)r.append("v",o);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}class zr extends St{__height;static getType(){return"tablerow"}static clone(t){return new zr(t.__height,t.__key)}static importDOM(){return{tr:t=>({conversion:eP,priority:0})}}static importJSON(t){return Mi().updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setHeight(t.height)}constructor(t,n){super(n),this.__height=t}exportJSON(){const t=this.getHeight();return{...super.exportJSON(),...t===void 0?void 0:{height:t}}}createDOM(t){const n=document.createElement("tr");return this.__height&&(n.style.height=`${this.__height}px`),Qe(n,t.theme.tableRow),n}extractWithChild(t,n,r){return r==="html"}isShadowRoot(){return!0}setHeight(t){const n=this.getWritable();return n.__height=t,n}getHeight(){return this.getLatest().__height}updateDOM(t){return t.__height!==this.__height}canBeEmpty(){return!1}canIndent(){return!1}}function eP(e){const t=e;let n;return qh.test(t.style.height)&&(n=parseFloat(t.style.height)),{after:r=>nw(r,ge),node:Mi(n)}}function Mi(e){return _t(new zr(e))}function et(e){return e instanceof zr}const Yh=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,tP=Yh&&"documentMode"in document?document.documentMode:null,qy=Yh&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent);function nP(e,t,n=!0){const r=cc();for(let o=0;o<e;o++){const i=Mi();for(let s=0;s<t;s++){let a=rt.NO_STATUS;typeof n=="object"?(o===0&&n.rows&&(a|=rt.ROW),s===0&&n.columns&&(a|=rt.COLUMN)):n&&(o===0&&(a|=rt.ROW),s===0&&(a|=rt.COLUMN));const l=ln(a),c=ye();c.append(Fe()),l.append(c),i.append(l)}r.append(i)}return r}function rP(e){const t=we(e,n=>Xe(n));if(Xe(t))return t;throw new Error("Expected table cell to be inside of table.")}Yh&&"InputEvent"in window&&!tP&&new window.InputEvent("input");const of=(e,t)=>e===rt.BOTH||e===t?t:rt.NO_STATUS;function oP(e,t=!0){const[,,n]=jn(e),[r,o]=on(n,e,e),i=r[0].length,{startRow:s}=o;let a=null;if(t){const l=s+e.__rowSpan-1,c=r[l],u=Mi();for(let d=0;d<i;d++){const{cell:h,startRow:g}=c[d];if(g+h.__rowSpan-1<=l){const p=c[d].cell.__headerState,m=of(p,rt.COLUMN);u.append(ln(m).append(ye()))}else h.setRowSpan(h.__rowSpan+1)}const f=n.getChildAtIndex(l);et(f)||de(256),f.insertAfter(u),a=u}else{const l=s,c=r[l],u=Mi();for(let d=0;d<i;d++){const{cell:h,startRow:g}=c[d];if(g===l){const p=c[d].cell.__headerState,m=of(p,rt.COLUMN);u.append(ln(m).append(ye()))}else h.setRowSpan(h.__rowSpan+1)}const f=n.getChildAtIndex(l);et(f)||de(257),f.insertBefore(u),a=u}return a}function iP(e,t=!0,n=!0){const[,,r]=jn(e),[o,i]=on(r,e,e),s=o.length,{startColumn:a}=i,l=t?a+e.__colSpan-1:a-1,c=r.getFirstChild();et(c)||de(120);let u=null;function f(g=rt.NO_STATUS){const p=ln(g).append(ye());return u===null&&(u=p),p}let d=c;e:for(let g=0;g<s;g++){if(g!==0){const w=d.getNextSibling();et(w)||de(121),d=w}const p=o[g],m=p[l<0?0:l].cell.__headerState,x=of(m,rt.ROW);if(l<0){Zw(d,f(x));continue}const{cell:y,startColumn:v,startRow:b}=p[l];if(v+y.__colSpan-1<=l){let w=y,_=b,E=l;for(;_!==g&&w.__rowSpan>1;){if(E-=y.__colSpan,!(E>=0)){d.append(f(x));continue e}{const{cell:T,startRow:k}=p[E];w=T,_=k}}w.insertAfter(f(x))}else y.setColSpan(y.__colSpan+1)}u!==null&&n&&sP(u);const h=r.getColWidths();if(h){const g=[...h],p=l<0?0:l,m=g[p];g.splice(p,0,m),r.setColWidths(g)}return u}function sP(e){const t=e.getFirstDescendant();t==null?e.selectStart():t.getParentOrThrow().selectStart()}function Zw(e,t){const n=e.getFirstChild();n!==null?n.insertBefore(t):e.append(t)}function aP(e){if(e.length===0)return null;const t=rP(e[0]),[n]=Nr(t,null,null);let r=1/0,o=-1/0,i=1/0,s=-1/0;const a=new Set;for(const h of n)for(const g of h){if(!g||!g.cell)continue;const p=g.cell.getKey();if(!a.has(p)&&e.some(m=>m.is(g.cell))){a.add(p);const m=g.startRow,x=g.startColumn,y=g.cell.__rowSpan||1,v=g.cell.__colSpan||1;r=Math.min(r,m),o=Math.max(o,m+y-1),i=Math.min(i,x),s=Math.max(s,x+v-1)}}if(r===1/0||i===1/0)return null;const l=o-r+1,c=s-i+1,u=n[r][i];if(!u.cell)return null;const f=u.cell;f.setColSpan(c),f.setRowSpan(l);const d=new Set([f.getKey()]);for(let h=r;h<=o;h++)for(let g=i;g<=s;g++){const p=n[h][g];if(!p.cell)continue;const m=p.cell,x=m.getKey();d.has(x)||(d.add(x),lP(m)||f.append(...m.getChildren()),m.remove())}return f.getChildrenSize()===0&&f.append(ye()),f}function lP(e){if(e.getChildrenSize()!==1)return!1;const t=e.getFirstChildOrThrow();return!(!Yr(t)||!t.isEmpty())}function cP(e){const[t,n,r]=jn(e),o=t.__colSpan,i=t.__rowSpan;if(o===1&&i===1)return;const[s,a]=on(r,t,t),{startColumn:l,startRow:c}=a,u=t.__headerState&rt.COLUMN,f=Array.from({length:o},(g,p)=>{let m=u;for(let x=0;m!==0&&x<s.length;x++)m&=s[x][p+l].cell.__headerState;return m}),d=t.__headerState&rt.ROW,h=Array.from({length:i},(g,p)=>{let m=d;for(let x=0;m!==0&&x<s[0].length;x++)m&=s[p+c][x].cell.__headerState;return m});if(o>1){for(let g=1;g<o;g++)t.insertAfter(ln(f[g]|h[0]).append(ye()));t.setColSpan(1)}if(i>1){let g;for(let p=1;p<i;p++){const m=c+p,x=s[m];g=(g||n).getNextSibling(),et(g)||de(125);let y=null;for(let v=0;v<l;v++){const b=x[v],w=b.cell;b.startRow===m&&(y=w),w.__colSpan>1&&(v+=w.__colSpan-1)}if(y===null)for(let v=o-1;v>=0;v--)Zw(g,ln(f[v]|h[p]).append(ye()));else for(let v=o-1;v>=0;v--)y.insertAfter(ln(f[v]|h[p]).append(ye()))}t.setRowSpan(1)}}function on(e,t,n){const[r,o,i]=Nr(e,t,n);return o===null&&de(207),i===null&&de(208),[r,o,i]}function Nr(e,t,n){const r=[];let o=null,i=null;function s(l){let c=r[l];return c===void 0&&(r[l]=c=[]),c}const a=e.getChildren();for(let l=0;l<a.length;l++){const c=a[l];et(c)||de(209);const u=s(l);for(let f=c.getFirstChild(),d=0;f!=null;f=f.getNextSibling()){for(ge(f)||de(147);u[d]!==void 0;)d++;const h={cell:f,startColumn:d,startRow:l},{__rowSpan:g,__colSpan:p}=f;for(let m=0;m<g&&!(l+m>=a.length);m++){const x=s(l+m);for(let y=0;y<p;y++)x[d+y]=h}t!==null&&o===null&&t.is(f)&&(o=h),n!==null&&i===null&&n.is(f)&&(i=h)}}return[r,o,i]}function jn(e){let t;if(e instanceof kn)t=e;else if("__type"in e){const o=we(e,ge);ge(o)||de(148),t=o}else{const o=we(e.getNode(),ge);ge(o)||de(148),t=o}const n=t.getParent();et(n)||de(149);const r=n.getParent();return Xe(r)||de(210),[t,n,r]}function Nl(e,t,n){let r,o=Math.min(t.startColumn,n.startColumn),i=Math.min(t.startRow,n.startRow),s=Math.max(t.startColumn+t.cell.__colSpan-1,n.startColumn+n.cell.__colSpan-1),a=Math.max(t.startRow+t.cell.__rowSpan-1,n.startRow+n.cell.__rowSpan-1);do{r=!1;for(let l=0;l<e.length;l++)for(let c=0;c<e[0].length;c++){const u=e[l][c];if(!u)continue;const f=u.startColumn+u.cell.__colSpan-1,d=u.startRow+u.cell.__rowSpan-1,h=u.startColumn<=s&&f>=o,g=u.startRow<=a&&d>=i;if(h&&g){const p=Math.min(o,u.startColumn),m=Math.max(s,f),x=Math.min(i,u.startRow),y=Math.max(a,d);p===o&&m===s&&x===i&&y===a||(o=p,s=m,i=x,a=y,r=!0)}}}while(r);return{maxColumn:s,maxRow:a,minColumn:o,minRow:i}}function Yy(e){const[t,,n]=jn(e),r=n.getChildren(),o=r.length,i=r[0].getChildren().length,s=new Array(o);for(let a=0;a<o;a++)s[a]=new Array(i);for(let a=0;a<o;a++){const l=r[a].getChildren();let c=0;for(let u=0;u<l.length;u++){for(;s[a][c];)c++;const f=l[u],d=f.__rowSpan||1,h=f.__colSpan||1;for(let g=0;g<d;g++)for(let p=0;p<h;p++)s[a+g][c+p]=f;if(t===f)return{colSpan:h,columnIndex:c,rowIndex:a,rowSpan:d};c+=h}}return null}function Xy(e){const[[t,n,r,o],[i,s,a,l]]=["anchor","focus"].map(c=>{const u=e[c].getNode(),f=we(u,ge);ge(f)||de(238,c,u.getKey(),u.getType());const d=f.getParent();et(d)||de(239,c);const h=d.getParent();return Xe(h)||de(240,c),[u,f,d,h]});return o.is(l)||de(241),{anchorCell:n,anchorNode:t,anchorRow:r,anchorTable:o,focusCell:s,focusNode:i,focusRow:a,focusTable:l}}class lc{tableKey;anchor;focus;_cachedNodes;dirty;constructor(t,n,r){this.anchor=n,this.focus=r,n._selection=this,r._selection=this,this._cachedNodes=null,this.dirty=!1,this.tableKey=t}getStartEndPoints(){return[this.anchor,this.focus]}isValid(){if(this.tableKey==="root"||this.anchor.key==="root"||this.anchor.type!=="element"||this.focus.key==="root"||this.focus.type!=="element")return!1;const t=Le(this.tableKey),n=Le(this.anchor.key),r=Le(this.focus.key);return t!==null&&n!==null&&r!==null}isBackward(){return this.focus.isBefore(this.anchor)}getCachedNodes(){return this._cachedNodes}setCachedNodes(t){this._cachedNodes=t}is(t){return Ve(t)&&this.tableKey===t.tableKey&&this.anchor.is(t.anchor)&&this.focus.is(t.focus)}set(t,n,r){this.dirty=this.dirty||t!==this.tableKey||n!==this.anchor.key||r!==this.focus.key,this.tableKey=t,this.anchor.key=n,this.focus.key=r,this._cachedNodes=null}clone(){return new lc(this.tableKey,zt(this.anchor.key,this.anchor.offset,this.anchor.type),zt(this.focus.key,this.focus.offset,this.focus.type))}isCollapsed(){return!1}extract(){return this.getNodes()}insertRawText(t){}insertText(){}hasFormat(t){let n=0;this.getNodes().filter(ge).forEach(o=>{const i=o.getFirstChild();Yr(i)&&(n|=i.getTextFormat())});const r=jr[t];return(n&r)!==0}insertNodes(t){const n=this.focus.getNode();B(n)||de(151),Ls(n.select(0,n.getChildrenSize())).insertNodes(t)}getShape(){const{anchorCell:t,focusCell:n}=Xy(this),r=Yy(t);r===null&&de(153);const o=Yy(n);o===null&&de(155);const i=Math.min(r.columnIndex,o.columnIndex),s=Math.max(r.columnIndex+r.colSpan-1,o.columnIndex+o.colSpan-1),a=Math.min(r.rowIndex,o.rowIndex),l=Math.max(r.rowIndex+r.rowSpan-1,o.rowIndex+o.rowSpan-1);return{fromX:Math.min(i,s),fromY:Math.min(a,l),toX:Math.max(i,s),toY:Math.max(a,l)}}getNodes(){if(!this.isValid())return[];const t=this._cachedNodes;if(t!==null)return t;const{anchorTable:n,anchorCell:r,focusCell:o}=Xy(this),i=o.getParents()[1];if(i!==n){if(n.isParentOf(o)){const m=i.getParent();m==null&&de(159),this.set(this.tableKey,o.getKey(),m.getKey())}else{const m=n.getParent();m==null&&de(158),this.set(this.tableKey,m.getKey(),o.getKey())}return this.getNodes()}const[s,a,l]=on(n,r,o),{minColumn:c,maxColumn:u,minRow:f,maxRow:d}=Nl(s,a,l),h=new Map([[n.getKey(),n]]);let g=null;for(let m=f;m<=d;m++)for(let x=c;x<=u;x++){const{cell:y}=s[m][x],v=y.getParent();et(v)||de(160),v!==g&&(h.set(v.getKey(),v),g=v),h.has(y.getKey())||dP(y,b=>{h.set(b.getKey(),b)})}const p=Array.from(h.values());return Bi()||(this._cachedNodes=p),p}getTextContent(){const t=this.getNodes().filter(r=>ge(r));let n="";for(let r=0;r<t.length;r++){const o=t[r],i=o.__parent,s=(t[r+1]||{}).__parent;n+=o.getTextContent()+(s!==i?`
64
- `:" ")}return n}}function Ve(e){return e instanceof lc}function Jw(){const e=zt("root",0,"element"),t=zt("root",0,"element");return new lc("root",e,t)}function uP(e,t,n){e.getKey(),t.getKey(),n.getKey();const r=Y(),o=Ve(r)?r.clone():Jw();return o.set(e.getKey(),t.getKey(),n.getKey()),o}function dP(e,t){const n=[[e]];for(let r=n.at(-1);r!==void 0&&n.length>0;r=n.at(-1)){const o=r.pop();o===void 0?n.pop():t(o)!==!1&&B(o)&&n.push(o.getChildren())}}function Qw(e,t=Hi()){const n=Le(e);Xe(n)||de(231,e);const r=No(n,t.getElementByKey(e));return r===null&&de(232,e),{tableElement:r,tableNode:n}}class fP{focusX;focusY;listenersToRemove;table;isHighlightingCells;anchorX;anchorY;tableNodeKey;anchorCell;focusCell;anchorCellNodeKey;focusCellNodeKey;editor;tableSelection;hasHijackedSelectionStyles;isSelecting;pointerType;shouldCheckSelection;abortController;listenerOptions;nextFocus;constructor(t,n){this.isHighlightingCells=!1,this.anchorX=-1,this.anchorY=-1,this.focusX=-1,this.focusY=-1,this.listenersToRemove=new Set,this.tableNodeKey=n,this.editor=t,this.table={columns:0,domRows:[],rows:0},this.tableSelection=null,this.anchorCellNodeKey=null,this.focusCellNodeKey=null,this.anchorCell=null,this.focusCell=null,this.hasHijackedSelectionStyles=!1,this.isSelecting=!1,this.pointerType=null,this.shouldCheckSelection=!1,this.abortController=new AbortController,this.listenerOptions={signal:this.abortController.signal},this.nextFocus=null,this.trackTable()}getTable(){return this.table}removeListeners(){this.abortController.abort("removeListeners"),Array.from(this.listenersToRemove).forEach(t=>t()),this.listenersToRemove.clear()}$lookup(){return Qw(this.tableNodeKey,this.editor)}trackTable(){const t=new MutationObserver(n=>{this.editor.getEditorState().read(()=>{let r=!1;for(let s=0;s<n.length;s++){const a=n[s].target.nodeName;if(a==="TABLE"||a==="TBODY"||a==="THEAD"||a==="TR"){r=!0;break}}if(!r)return;const{tableNode:o,tableElement:i}=this.$lookup();this.table=bi(o,i)},{editor:this.editor})});this.editor.getEditorState().read(()=>{const{tableNode:n,tableElement:r}=this.$lookup();this.table=bi(n,r),t.observe(r,{attributes:!0,childList:!0,subtree:!0})},{editor:this.editor})}$clearHighlight(){const t=this.editor;this.isHighlightingCells=!1,this.anchorX=-1,this.anchorY=-1,this.focusX=-1,this.focusY=-1,this.tableSelection=null,this.anchorCellNodeKey=null,this.focusCellNodeKey=null,this.anchorCell=null,this.focusCell=null,this.hasHijackedSelectionStyles=!1,this.$enableHighlightStyle();const{tableNode:n,tableElement:r}=this.$lookup();Pa(t,bi(n,r),null),Y()!==null&&(Ge(null),t.dispatchCommand(cr,void 0))}$enableHighlightStyle(){const t=this.editor,{tableElement:n}=this.$lookup();Un(n,t._config.theme.tableSelection),n.classList.remove("disable-selection"),this.hasHijackedSelectionStyles=!1}$disableHighlightStyle(){const{tableElement:t}=this.$lookup();Qe(t,this.editor._config.theme.tableSelection),this.hasHijackedSelectionStyles=!0}$updateTableTableSelection(t){if(t!==null){t.tableKey!==this.tableNodeKey&&de(233,t.tableKey,this.tableNodeKey);const n=this.editor;this.tableSelection=t,this.isHighlightingCells=!0,this.$disableHighlightStyle(),this.updateDOMSelection(),Pa(n,this.table,this.tableSelection)}else this.$clearHighlight()}setShouldCheckSelection(){this.shouldCheckSelection=!0}getAndClearShouldCheckSelection(){return!!this.shouldCheckSelection&&(this.shouldCheckSelection=!1,!0)}setNextFocus(t){this.nextFocus=t}getAndClearNextFocus(){const{nextFocus:t}=this;return t!==null&&(this.nextFocus=null),t}updateDOMSelection(){if(this.anchorCell!==null&&this.focusCell!==null){const t=Lt(this.editor._window);t&&t.rangeCount>0&&t.removeAllRanges()}}$setFocusCellForSelection(t,n=!1){const r=this.editor,{tableNode:o}=this.$lookup(),i=t.x,s=t.y;if(this.focusCell=t,this.isHighlightingCells||this.anchorX===i&&this.anchorY===s&&!n){if(i===this.focusX&&s===this.focusY)return!1}else this.isHighlightingCells=!0,this.$disableHighlightStyle();if(this.focusX=i,this.focusY=s,this.isHighlightingCells){const a=af(o,t.elem);if(this.tableSelection!=null&&this.anchorCellNodeKey!=null&&a!==null)return this.focusCellNodeKey=a.getKey(),this.tableSelection=uP(o,this.$getAnchorTableCellOrThrow(),a),Ge(this.tableSelection),r.dispatchCommand(cr,void 0),Pa(r,this.table,this.tableSelection),!0}return!1}$getAnchorTableCell(){return this.anchorCellNodeKey?Le(this.anchorCellNodeKey):null}$getAnchorTableCellOrThrow(){const t=this.$getAnchorTableCell();return t===null&&de(234),t}$getFocusTableCell(){return this.focusCellNodeKey?Le(this.focusCellNodeKey):null}$getFocusTableCellOrThrow(){const t=this.$getFocusTableCell();return t===null&&de(235),t}$setAnchorCellForSelection(t){this.isHighlightingCells=!1,this.anchorCell=t,this.anchorX=t.x,this.anchorY=t.y;const{tableNode:n}=this.$lookup(),r=af(n,t.elem);if(r!==null){const o=r.getKey();this.tableSelection=this.tableSelection!=null?this.tableSelection.clone():Jw(),this.anchorCellNodeKey=o}}$formatCells(t){const n=Y();Ve(n)||de(236);const r=Zl(),o=r.anchor,i=r.focus,s=n.getNodes().filter(ge);s.length>0||de(237);const a=s[0].getFirstChild(),l=Yr(a)?a.getFormatFlags(t,null):null;s.forEach(c=>{o.set(c.getKey(),0,"element"),i.set(c.getKey(),c.getChildrenSize(),"element"),r.formatText(t,l)}),Ge(n),this.editor.dispatchCommand(cr,void 0)}$clearText(){const{editor:t}=this,n=Le(this.tableNodeKey);if(!Xe(n))throw new Error("Expected TableNode.");const r=Y();Ve(r)||de(253);const o=r.getNodes().filter(ge),i=n.getFirstChild(),s=n.getLastChild();if(o.length>0&&i!==null&&s!==null&&et(i)&&et(s)&&o[0]===i.getFirstChild()&&o[o.length-1]===s.getLastChild()){n.selectPrevious();const a=n.getParent();return n.remove(),void(ot(a)&&a.isEmpty()&&t.dispatchCommand(_o,void 0))}o.forEach(a=>{if(B(a)){const l=ye(),c=Fe();l.append(c),a.append(l),a.getChildren().forEach(u=>{u!==l&&u.remove()})}}),Pa(t,this.table,null),Ge(null),t.dispatchCommand(cr,void 0)}}const sf="__lexicalTableSelection";function ri(e){return Be(e)&&e.nodeName==="TABLE"}function No(e,t){if(!t)return t;const n=ri(t)?t:e.getDOMSlot(t).element;return n.nodeName!=="TABLE"&&de(245,t.nodeName),n}function Xh(e){return e._window}function _s(e,t){for(let n=t,r=null;n!==null;n=n.getParent()){if(e.is(n))return r;ge(n)&&(r=n)}return null}const hP=[[hh,"down"],[fh,"up"],[dh,"backward"],[uh,"forward"]],gP=[Ri,To,Fr],pP=[Ul,ph];function mP(e,t,n,r){const o=n.getRootElement(),i=Xh(n);o!==null&&i!==null||de(246);const s=new fP(n,e.getKey()),a=No(e,t);(function(h,g){Zy(h)!==null&&de(205),h[sf]=g})(a,s),s.listenersToRemove.add(()=>(function(h,g){Zy(h)===g&&delete h[sf]})(a,s));const l=h=>{if(s.pointerType=h.pointerType,h.button!==0||!xn(h.target)||!i)return;const g=Pl(h.target);g!==null&&n.update(()=>{const p=qn();if(qy&&h.shiftKey&&Fn(p,e)&&(W(p)||Ve(p))){const m=p.anchor.getNode(),x=_s(e,p.anchor.getNode());x?(s.$setAnchorCellForSelection(uo(s,x)),s.$setFocusCellForSelection(g),lr(h)):(e.isBefore(m)?e.selectStart():e.selectEnd()).anchor.set(p.anchor.key,p.anchor.offset,p.anchor.type)}else h.pointerType!=="touch"&&s.$setAnchorCellForSelection(g)}),(()=>{if(s.isSelecting)return;const p=()=>{s.isSelecting=!1,i.removeEventListener("pointerup",p),i.removeEventListener("pointermove",m)},m=x=>{if(1&~x.buttons&&s.isSelecting)return s.isSelecting=!1,i.removeEventListener("pointerup",p),void i.removeEventListener("pointermove",m);if(!xn(x.target))return;let y=null;const v=!(qy||a.contains(x.target));if(v)y=Jy(a,x.target);else for(const b of document.elementsFromPoint(x.clientX,x.clientY))if(y=Jy(a,b),y)break;!y||s.focusCell!==null&&y.elem===s.focusCell.elem||(s.setNextFocus({focusCell:y,override:v}),n.dispatchCommand(cr,void 0))};s.isSelecting=!0,i.addEventListener("pointerup",p,s.listenerOptions),i.addEventListener("pointermove",m,s.listenerOptions)})()};a.addEventListener("pointerdown",l,s.listenerOptions),s.listenersToRemove.add(()=>{a.removeEventListener("pointerdown",l)});const c=h=>{h.detail>=3&&xn(h.target)&&Pl(h.target)!==null&&h.preventDefault()};a.addEventListener("mousedown",c,s.listenerOptions),s.listenersToRemove.add(()=>{a.removeEventListener("mousedown",c)});const u=h=>{const g=h.target;h.button===0&&xn(g)&&n.update(()=>{const p=Y();Ve(p)&&p.tableKey===s.tableNodeKey&&o.contains(g)&&s.$clearHighlight()})};i.addEventListener("pointerdown",u,s.listenerOptions),s.listenersToRemove.add(()=>{i.removeEventListener("pointerdown",u)});for(const[h,g]of hP)s.listenersToRemove.add(n.registerCommand(h,p=>nC(n,p,g,e,s),$t));s.listenersToRemove.add(n.registerCommand(gh,h=>{const g=Y();if(Ve(g)){const p=_s(e,g.focus.getNode());if(p!==null)return lr(h),p.selectEnd(),!0}return!1},$t));const f=h=>()=>{const g=Y();if(!Fn(g,e))return!1;if(Ve(g))return s.$clearText(),!0;if(W(g)){if(!ge(_s(e,g.anchor.getNode())))return!1;const p=g.anchor.getNode(),m=g.focus.getNode(),x=e.isParentOf(p),y=e.isParentOf(m);if(x&&!y||y&&!x)return s.$clearText(),!0;const v=we(g.anchor.getNode(),w=>B(w)),b=v&&we(v,w=>B(w)&&ge(w.getParent()));if(!B(b)||!B(v))return!1;if(h===To&&b.getPreviousSibling()===null)return!0}return!1};for(const h of gP)s.listenersToRemove.add(n.registerCommand(h,f(h),$t));const d=h=>{const g=Y();if(!Ve(g)&&!W(g))return!1;const p=e.isParentOf(g.anchor.getNode());if(p!==e.isParentOf(g.focus.getNode())){const m=p?"anchor":"focus",x=p?"focus":"anchor",{key:y,offset:v,type:b}=g[x];return e[g[m].isBefore(g[x])?"selectPrevious":"selectNext"]()[x].set(y,v,b),!1}return!!Fn(g,e)&&!!Ve(g)&&(h&&(h.preventDefault(),h.stopPropagation()),s.$clearText(),!0)};for(const h of pP)s.listenersToRemove.add(n.registerCommand(h,d,$t));return s.listenersToRemove.add(n.registerCommand(ql,h=>{const g=Y();if(g){if(!Ve(g)&&!W(g))return!1;Zd(n,Ar(h,ClipboardEvent)?h:null,_w(g));const p=d(h);return W(g)?(g.removeText(),!0):p}return!1},$t)),s.listenersToRemove.add(n.registerCommand(It,h=>{const g=Y();if(!Fn(g,e))return!1;if(Ve(g))return s.$formatCells(h),!0;if(W(g)){const p=we(g.anchor.getNode(),m=>ge(m));if(!ge(p))return!1}return!1},$t)),s.listenersToRemove.add(n.registerCommand(pi,h=>{const g=Y();if(!Ve(g)||!Fn(g,e))return!1;const p=g.anchor.getNode(),m=g.focus.getNode();if(!ge(p)||!ge(m))return!1;if((function(k,P){if(Ve(k)){const O=k.anchor.getNode(),D=k.focus.getNode();if(P&&O&&D){const[I]=on(P,O,D);return O.getKey()===I[0][0].cell.getKey()&&D.getKey()===I[I.length-1].at(-1).cell.getKey()}}return!1})(g,e))return e.setFormat(h),!0;const[x,y,v]=on(e,p,m),b=Math.max(y.startRow+y.cell.__rowSpan-1,v.startRow+v.cell.__rowSpan-1),w=Math.max(y.startColumn+y.cell.__colSpan-1,v.startColumn+v.cell.__colSpan-1),_=Math.min(y.startRow,v.startRow),E=Math.min(y.startColumn,v.startColumn),T=new Set;for(let k=_;k<=b;k++)for(let P=E;P<=w;P++){const O=x[k][P].cell;if(T.has(O))continue;T.add(O),O.setFormat(h);const D=O.getChildren();for(let I=0;I<D.length;I++){const $=D[I];B($)&&!$.isInline()&&$.setFormat(h)}}return!0},$t)),s.listenersToRemove.add(n.registerCommand(vo,h=>{const g=Y();if(!Fn(g,e))return!1;if(Ve(g))return s.$clearHighlight(),!1;if(W(g)){const p=we(g.anchor.getNode(),m=>ge(m));if(!ge(p))return!1;if(typeof h=="string"){const m=tv(n,g,e);if(m)return ev(m,e,[Fe(h)]),!0}}return!1},$t)),r&&s.listenersToRemove.add(n.registerCommand(mh,h=>{const g=Y();if(!W(g)||!g.isCollapsed()||!Fn(g,e))return!1;const p=os(g.anchor.getNode());return!(p===null||!e.is(wi(p)))&&(lr(h),(function(m,x){const y=x==="next"?"getNextSibling":"getPreviousSibling",v=x==="next"?"getFirstChild":"getLastChild",b=m[y]();if(B(b))return b.selectEnd();const w=we(m,et);w===null&&de(247);for(let E=w[y]();et(E);E=E[y]()){const T=E[v]();if(B(T))return T.selectEnd()}const _=we(w,Xe);_===null&&de(248),x==="next"?_.selectNext():_.selectPrevious()})(p,h.shiftKey?"previous":"next"),!0)},$t)),s.listenersToRemove.add(n.registerCommand(J1,h=>e.isSelected(),$t)),s.listenersToRemove.add(n.registerCommand(lh,(h,g)=>{if(n!==g)return!1;const{nodes:p,selection:m}=h,x=m.getStartEndPoints(),y=Ve(m),v=W(m)&&we(m.anchor.getNode(),ne=>ge(ne))!==null&&we(m.focus.getNode(),ne=>ge(ne))!==null||y;if(p.length!==1||!Xe(p[0])||!v||x===null)return!1;const[b,w]=x,[_,E,T]=jn(b),k=we(w.getNode(),ne=>ge(ne));if(!(ge(_)&&ge(k)&&et(E)&&Xe(T)))return!1;const P=p[0],[O,D,I]=on(T,_,k),[$]=Nr(P,null,null),H=O.length,U=H>0?O[0].length:0;let L=D.startRow,N=D.startColumn,V=$.length,K=V>0?$[0].length:0;if(y){const ne=Nl(O,D,I),ve=ne.maxRow-ne.minRow+1,Ee=ne.maxColumn-ne.minColumn+1;L=ne.minRow,N=ne.minColumn,V=Math.min(V,ve),K=Math.min(K,Ee)}let te=!1;const J=Math.min(H,L+V)-1,Z=Math.min(U,N+K)-1,ae=new Set;for(let ne=L;ne<=J;ne++)for(let ve=N;ve<=Z;ve++){const Ee=O[ne][ve];ae.has(Ee.cell.getKey())||Ee.cell.__rowSpan===1&&Ee.cell.__colSpan===1||(cP(Ee.cell),ae.add(Ee.cell.getKey()),te=!0)}let[oe]=Nr(T.getWritable(),null,null);const fe=V-H+L;for(let ne=0;ne<fe;ne++)oP(oe[H-1][0].cell);const Te=K-U+N;for(let ne=0;ne<Te;ne++)iP(oe[0][U-1].cell,!0,!1);[oe]=Nr(T.getWritable(),null,null);for(let ne=L;ne<L+V;ne++)for(let ve=N;ve<N+K;ve++){const Ee=ne-L,De=ve-N,st=$[Ee][De];if(st.startRow!==Ee||st.startColumn!==De)continue;const ee=st.cell;if(ee.__rowSpan!==1||ee.__colSpan!==1){const Re=[],mt=Math.min(ne+ee.__rowSpan,L+V)-1,Ft=Math.min(ve+ee.__colSpan,N+K)-1;for(let Yt=ne;Yt<=mt;Yt++)for(let Xt=ve;Xt<=Ft;Xt++){const xe=oe[Yt][Xt];Re.push(xe.cell)}aP(Re),te=!0}const{cell:Ce}=oe[ne][ve],ze=Ce.getChildren();ee.getChildren().forEach(Re=>{X(Re)&&ye().append(Re),Ce.append(Re)}),ze.forEach(Re=>Re.remove())}if(y&&te){const[ne]=Nr(T.getWritable(),null,null);ne[D.startRow][D.startColumn].cell.selectEnd()}return!0},$t)),s.listenersToRemove.add(n.registerCommand(cr,()=>{const h=Y(),g=qn(),p=s.getAndClearNextFocus();if(p!==null){const{focusCell:m}=p;if(Ve(h)&&h.tableKey===s.tableNodeKey)return(m.x!==s.focusX||m.y!==s.focusY)&&(s.$setFocusCellForSelection(m),!0);if(m!==s.anchorCell&&Fn(h,e))return s.$setFocusCellForSelection(m),!0}if(s.getAndClearShouldCheckSelection()&&W(g)&&W(h)&&h.isCollapsed()){const m=h.anchor.getNode(),x=e.getFirstChild(),y=os(m);if(y!==null&&et(x)){const v=x.getFirstChild();if(ge(v)&&e.is(we(y,b=>b.is(e)||b.is(v))))return v.selectStart(),!0}}if(W(h)){const{anchor:m,focus:x}=h,y=m.getNode(),v=x.getNode(),b=os(y),w=os(v),_=!(!b||!e.is(wi(b))),E=!(!w||!e.is(wi(w))),T=_!==E,k=_&&E,P=h.isBackward();if(T){const O=h.clone();if(E){const[D]=on(e,w,w),I=D[0][0].cell,$=D[D.length-1].at(-1).cell;O.focus.set(P?I.getKey():$.getKey(),P?0:$.getChildrenSize(),"element")}else if(_){const[D]=on(e,b,b),I=D[0][0].cell,$=D[D.length-1].at(-1).cell;O.anchor.set(P?$.getKey():I.getKey(),P?$.getChildrenSize():0,"element")}Ge(O),Qy(n,s)}else if(k&&(b.is(w)||(s.$setAnchorCellForSelection(uo(s,b)),s.$setFocusCellForSelection(uo(s,w),!0)),s.pointerType==="touch"&&s.isSelecting&&h.isCollapsed()&&W(g)&&g.isCollapsed())){const O=os(g.anchor.getNode());O&&!O.is(w)&&(s.$setAnchorCellForSelection(uo(s,O)),s.$setFocusCellForSelection(uo(s,w),!0),s.pointerType=null)}}else if(h&&Ve(h)&&h.is(g)&&h.tableKey===e.getKey()){const m=Lt(i);if(m&&m.anchorNode&&m.focusNode){const x=Ht(m.focusNode),y=x&&!e.isParentOf(x),v=Ht(m.anchorNode),b=v&&e.isParentOf(v);if(y&&b&&m.rangeCount>0){const w=aA(m,n);w&&(w.anchor.set(e.getKey(),h.isBackward()?e.getChildrenSize():0,"element"),m.removeAllRanges(),Ge(w))}}}return h&&!h.is(g)&&(Ve(h)||Ve(g))&&s.tableSelection&&!s.tableSelection.is(g)?(Ve(h)&&h.tableKey===s.tableNodeKey?s.$updateTableTableSelection(h):!Ve(h)&&Ve(g)&&g.tableKey===s.tableNodeKey&&s.$updateTableTableSelection(null),!1):(s.hasHijackedSelectionStyles&&!e.isSelected()?(function(m,x){x.$enableHighlightStyle(),Zh(x.table,y=>{const v=y.elem;y.highlighted=!1,tC(m,y),v.getAttribute("style")||v.removeAttribute("style")})})(n,s):!s.hasHijackedSelectionStyles&&e.isSelected()&&Qy(n,s),!1)},$t)),s.listenersToRemove.add(n.registerCommand(_o,()=>{const h=Y();if(!W(h)||!h.isCollapsed()||!Fn(h,e))return!1;const g=tv(n,h,e);return!!g&&(ev(g,e),!0)},$t)),s}function Zy(e){return e[sf]||null}function Pl(e){let t=e;for(;t!=null;){const n=t.nodeName;if(n==="TD"||n==="TH"){const r=t._cell;return r===void 0?null:r}t=t.parentNode}return null}function Jy(e,t){if(!e.contains(t))return null;let n=null;for(let r=t;r!=null;r=r.parentNode){if(r===e)return n;const o=r.nodeName;o!=="TD"&&o!=="TH"||(n=r._cell||null)}return null}function bi(e,t){const n=[],r={columns:0,domRows:n,rows:0};let o=No(e,t).querySelector("tr"),i=0,s=0;for(n.length=0;o!=null;){const a=o.nodeName;if(a==="TD"||a==="TH"){const u={elem:o,hasBackgroundColor:o.style.backgroundColor!=="",highlighted:!1,x:i,y:s};o._cell=u;let f=n[s];f===void 0&&(f=n[s]=[]),f[i]=u}else{const u=o.firstChild;if(u!=null){o=u;continue}}const l=o.nextSibling;if(l!=null){i++,o=l;continue}const c=o.parentNode;if(c!=null){const u=c.nextSibling;if(u==null)break;s++,i=0,o=u}}return r.columns=i+1,r.rows=s+1,r}function Pa(e,t,n){const r=new Set(n?n.getNodes():[]);Zh(t,(o,i)=>{const s=o.elem;r.has(i)?(o.highlighted=!0,eC(e,o)):(o.highlighted=!1,tC(e,o),s.getAttribute("style")||s.removeAttribute("style"))})}function Zh(e,t){const{domRows:n}=e;for(let r=0;r<n.length;r++){const o=n[r];if(o)for(let i=0;i<o.length;i++){const s=o[i];if(!s)continue;const a=Ht(s.elem);a!==null&&t(s,a,{x:i,y:r})}}}function Qy(e,t){t.$disableHighlightStyle(),Zh(t.table,n=>{n.highlighted=!0,eC(e,n)})}const yP=(e,t,n,r,o)=>{const i=o==="forward";switch(o){case"backward":case"forward":return n!==(i?e.table.columns-1:0)?Fa(t.getCellNodeFromCordsOrThrow(n+(i?1:-1),r,e.table),i):r!==(i?e.table.rows-1:0)?Fa(t.getCellNodeFromCordsOrThrow(i?0:e.table.columns-1,r+(i?1:-1),e.table),i):i?t.selectNext():t.selectPrevious(),!0;case"up":return r!==0?Fa(t.getCellNodeFromCordsOrThrow(n,r-1,e.table),!1):t.selectPrevious(),!0;case"down":return r!==e.table.rows-1?Fa(t.getCellNodeFromCordsOrThrow(n,r+1,e.table),!0):t.selectNext(),!0;default:return!1}};function uu(e,t){let n,r;if(t.startColumn===e.minColumn)n="minColumn";else{if(t.startColumn+t.cell.__colSpan-1!==e.maxColumn)return null;n="maxColumn"}if(t.startRow===e.minRow)r="minRow";else{if(t.startRow+t.cell.__rowSpan-1!==e.maxRow)return null;r="maxRow"}return[n,r]}function La([e,t]){return[e==="minColumn"?"maxColumn":"minColumn",t==="minRow"?"maxRow":"minRow"]}function Go(e,t,[n,r]){const o=t[r],i=e[o];i===void 0&&de(250,r,String(o));const s=t[n],a=i[s];return a===void 0&&de(250,n,String(s)),a}function vP(e,t,n,r,o){const i=Nl(t,n,r),s=(function(_,E){const{minColumn:T,maxColumn:k,minRow:P,maxRow:O}=E;let D=1,I=1,$=1,H=1;const U=_[P],L=_[O];for(let N=T;N<=k;N++)D=Math.max(D,U[N].cell.__rowSpan),H=Math.max(H,L[N].cell.__rowSpan);for(let N=P;N<=O;N++)I=Math.max(I,_[N][T].cell.__colSpan),$=Math.max($,_[N][k].cell.__colSpan);return{bottomSpan:H,leftSpan:I,rightSpan:$,topSpan:D}})(t,i),{topSpan:a,leftSpan:l,bottomSpan:c,rightSpan:u}=s,f=(function(_,E){const T=uu(_,E);return T===null&&de(249,E.cell.getKey()),T})(i,n),[d,h]=La(f);let g=i[d],p=i[h];o==="forward"?g+=d==="maxColumn"?1:l:o==="backward"?g-=d==="minColumn"?1:u:o==="down"?p+=h==="maxRow"?1:a:o==="up"&&(p-=h==="minRow"?1:c);const m=t[p];if(m===void 0)return!1;const x=m[g];if(x===void 0)return!1;const[y,v]=(function(_,E,T){const k=Nl(_,E,T),P=uu(k,E);if(P)return[Go(_,k,P),Go(_,k,La(P))];const O=uu(k,T);if(O)return[Go(_,k,La(O)),Go(_,k,O)];const D=["minColumn","minRow"];return[Go(_,k,D),Go(_,k,La(D))]})(t,n,x),b=uo(e,y.cell),w=uo(e,v.cell);return e.$setAnchorCellForSelection(b),e.$setFocusCellForSelection(w,!0),!0}function Fn(e,t){if(W(e)||Ve(e)){const n=t.isParentOf(e.anchor.getNode()),r=t.isParentOf(e.focus.getNode());return n&&r}return!1}function Fa(e,t){t?e.selectStart():e.selectEnd()}function eC(e,t){const n=t.elem,r=e._config.theme;ge(Ht(n))||de(131),Qe(n,r.tableCellSelected)}function tC(e,t){const n=t.elem;ge(Ht(n))||de(131);const r=e._config.theme;Un(n,r.tableCellSelected)}function os(e){const t=we(e,ge);return ge(t)?t:null}function wi(e){const t=we(e,Xe);return Xe(t)?t:null}function xP(e,t,n,r,o,i,s){const a=En(n.focus,o?"previous":"next");if(Ih(a))return!1;let l=a;for(const m of Ds(a).iterNodeCarets("shadowRoot")){if(!Vr(m)||!B(m.origin))return!1;l=m}const c=l.getParentAtCaret();if(!ge(c))return!1;const u=c,f=(function(m){for(const x of Ds(m).iterNodeCarets("root")){const{origin:y}=x;if(ge(y)){if(jt(x))return Nt(y,m.direction)}else if(!et(y))break}return null})(tt(u,l.direction)),d=we(u,Xe);if(!d||!d.is(i))return!1;const h=e.getElementByKey(u.getKey()),g=Pl(h);if(!h||!g)return!1;const p=wP(e,d);if(s.table=p,f)if(r==="extend"){const m=Pl(e.getElementByKey(f.origin.getKey()));if(!m)return!1;s.$setAnchorCellForSelection(g),s.$setFocusCellForSelection(m,!0)}else{const m=Mt(f);bn(n.anchor,m),bn(n.focus,m)}else if(r==="extend")s.$setAnchorCellForSelection(g),s.$setFocusCellForSelection(g,!0);else{const m=(function(x){const y=ta(x);return jt(y)?Mt(y):x})(tt(d,a.direction));bn(n.anchor,m),bn(n.focus,m)}return lr(t),!0}function nC(e,t,n,r,o){if((n==="up"||n==="down")&&(function(s){const a=s.getRootElement();return a?a.hasAttribute("aria-controls")&&a.getAttribute("aria-controls")==="typeahead-menu":!1})(e))return!1;const i=Y();if(!Fn(i,r)){if(W(i)){if(n==="backward"){if(i.focus.offset>0)return!1;const s=(function(l){for(let c=l,u=l;u!==null;c=u,u=u.getParent())if(B(u)){if(u!==c&&u.getFirstChild()!==c)return null;if(!u.isInline())return u}return null})(i.focus.getNode());if(!s)return!1;const a=s.getPreviousSibling();return!!Xe(a)&&(lr(t),t.shiftKey?i.focus.set(a.getParentOrThrow().getKey(),a.getIndexWithinParent(),"element"):a.selectEnd(),!0)}if(t.shiftKey&&(n==="up"||n==="down")){const s=i.focus.getNode();if(!i.isCollapsed()&&(n==="up"&&!i.isBackward()||n==="down"&&i.isBackward())){let a=we(s,d=>Xe(d));if(ge(a)&&(a=we(a,Xe)),a!==r||!a)return!1;const l=n==="down"?a.getNextSibling():a.getPreviousSibling();if(!l)return!1;let c=0;n==="up"&&B(l)&&(c=l.getChildrenSize());let u=l;n==="up"&&B(l)&&(u=l.getLastChild()||l,c=X(u)?u.getTextContentSize():0);const f=i.clone();return f.focus.set(u.getKey(),c,X(u)?"text":"element"),Ge(f),lr(t),!0}if(pt(s)){const a=n==="up"?i.getNodes()[i.getNodes().length-1]:i.getNodes()[0];if(a&&_s(r,a)!==null){const l=r.getFirstDescendant(),c=r.getLastDescendant();if(!l||!c)return!1;const[u]=jn(l),[f]=jn(c),d=r.getCordsFromCellNode(u,o.table),h=r.getCordsFromCellNode(f,o.table),g=r.getDOMCellFromCordsOrThrow(d.x,d.y,o.table),p=r.getDOMCellFromCordsOrThrow(h.x,h.y,o.table);return o.$setAnchorCellForSelection(g),o.$setFocusCellForSelection(p,!0),!0}return!1}{let a=we(s,c=>B(c)&&!c.isInline());if(ge(a)&&(a=we(a,Xe)),!a)return!1;const l=n==="down"?a.getNextSibling():a.getPreviousSibling();if(Xe(l)&&o.tableNodeKey===l.getKey()){const c=l.getFirstDescendant(),u=l.getLastDescendant();if(!c||!u)return!1;const[f]=jn(c),[d]=jn(u),h=i.clone();return h.focus.set((n==="up"?f:d).getKey(),n==="up"?0:d.getChildrenSize(),"element"),lr(t),Ge(h),!0}}}}return n==="down"&&Ll(e)&&o.setShouldCheckSelection(),!1}if(W(i)){if(n==="backward"||n==="forward")return xP(e,t,i,t.shiftKey?"extend":"move",n==="backward",r,o);if(i.isCollapsed()){const{anchor:s,focus:a}=i,l=we(s.getNode(),ge),c=we(a.getNode(),ge);if(!ge(l)||!l.is(c))return!1;const u=wi(l);if(u!==r&&u!=null){const x=No(u,e.getElementByKey(u.getKey()));if(x!=null)return o.table=bi(u,x),nC(e,t,n,u,o)}const f=e.getElementByKey(l.__key),d=e.getElementByKey(s.key);if(d==null||f==null)return!1;let h;if(s.type==="element")h=d.getBoundingClientRect();else{const x=Lt(Xh(e));if(x===null||x.rangeCount===0)return!1;h=x.getRangeAt(0).getBoundingClientRect()}const g=n==="up"?l.getFirstChild():l.getLastChild();if(g==null)return!1;const p=e.getElementByKey(g.__key);if(p==null)return!1;const m=p.getBoundingClientRect();if(n==="up"?m.top>h.top-h.height:h.bottom+h.height>m.bottom){lr(t);const x=r.getCordsFromCellNode(l,o.table);if(!t.shiftKey)return yP(o,r,x.x,x.y,n);{const y=r.getDOMCellFromCordsOrThrow(x.x,x.y,o.table);o.$setAnchorCellForSelection(y),o.$setFocusCellForSelection(y,!0)}return!0}}}else if(Ve(i)){const{anchor:s,focus:a}=i,l=we(s.getNode(),ge),c=we(a.getNode(),ge),[u]=i.getNodes();Xe(u)||de(251);const f=No(u,e.getElementByKey(u.getKey()));if(!ge(l)||!ge(c)||!Xe(u)||f==null)return!1;o.$updateTableTableSelection(i);const d=bi(u,f),h=r.getCordsFromCellNode(l,d),g=r.getDOMCellFromCordsOrThrow(h.x,h.y,d);if(o.$setAnchorCellForSelection(g),lr(t),t.shiftKey){const[p,m,x]=on(r,l,c);return vP(o,p,m,x,n)}return c.selectEnd(),!0}return!1}function lr(e){e.preventDefault(),e.stopImmediatePropagation(),e.stopPropagation()}function ev(e,t,n){const r=ye();e==="first"?t.insertBefore(r):t.insertAfter(r),r.append(...n||[]),r.selectEnd()}function tv(e,t,n){const r=n.getParent();if(!r)return;const o=Lt(Xh(e));if(!o)return;const i=o.anchorNode,s=e.getElementByKey(r.getKey()),a=No(n,e.getElementByKey(n.getKey()));if(!i||!s||!a||!s.contains(i)||a.contains(i))return;const l=we(t.anchor.getNode(),y=>ge(y));if(!l)return;const c=we(l,y=>Xe(y));if(!Xe(c)||!c.is(n))return;const[u,f]=on(n,l,l),d=u[0][0],h=u[u.length-1][u[0].length-1],{startRow:g,startColumn:p}=f,m=g===d.startRow&&p===d.startColumn,x=g===h.startRow&&p===h.startColumn;return m?"first":x?"last":void 0}function uo(e,t){const{tableNode:n}=e.$lookup(),r=n.getCordsFromCellNode(t,e.table);return n.getDOMCellFromCordsOrThrow(r.x,r.y,e.table)}function af(e,t,n){return _s(e,Ht(t,n))}function nv(e,t,n){if(!t.theme.tableAlignment)return;const r=[],o=[];for(const i of["center","right"]){const s=t.theme.tableAlignment[i];s&&(i===n?o:r).push(s)}Un(e,...r),Qe(e,...o)}const lf=new WeakSet;function Ll(e=Hi()){return lf.has(e)}function bP(e,t){t?lf.add(e):lf.delete(e)}class An extends St{__rowStriping;__frozenColumnCount;__frozenRowCount;__colWidths;static getType(){return"table"}getColWidths(){return this.getLatest().__colWidths}setColWidths(t){const n=this.getWritable();return n.__colWidths=t,n}static clone(t){return new An(t.__key)}afterCloneFrom(t){super.afterCloneFrom(t),this.__colWidths=t.__colWidths,this.__rowStriping=t.__rowStriping,this.__frozenColumnCount=t.__frozenColumnCount,this.__frozenRowCount=t.__frozenRowCount}static importDOM(){return{table:t=>({conversion:CP,priority:1})}}static importJSON(t){return cc().updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setRowStriping(t.rowStriping||!1).setFrozenColumns(t.frozenColumnCount||0).setFrozenRows(t.frozenRowCount||0).setColWidths(t.colWidths)}constructor(t){super(t),this.__rowStriping=!1,this.__frozenColumnCount=0,this.__frozenRowCount=0,this.__colWidths=void 0}exportJSON(){return{...super.exportJSON(),colWidths:this.getColWidths(),frozenColumnCount:this.__frozenColumnCount?this.__frozenColumnCount:void 0,frozenRowCount:this.__frozenRowCount?this.__frozenRowCount:void 0,rowStriping:this.__rowStriping?this.__rowStriping:void 0}}extractWithChild(t,n,r){return r==="html"}getDOMSlot(t){const n=ri(t)?t:t.querySelector("table");return ri(n)||de(229),super.getDOMSlot(t).withElement(n).withAfter(n.querySelector("colgroup"))}createDOM(t,n){const r=document.createElement("table");this.__style&&(r.style.cssText=this.__style);const o=document.createElement("colgroup");if(r.appendChild(o),AA(o),Qe(r,t.theme.table),this.updateTableElement(null,r,t),Ll(n)){const i=document.createElement("div"),s=t.theme.tableScrollableWrapper;return s?Qe(i,s):i.style.cssText="overflow-x: auto;",i.appendChild(r),this.updateTableWrapper(null,i,r,t),i}return r}updateTableWrapper(t,n,r,o){this.__frozenColumnCount!==(t?t.__frozenColumnCount:0)&&(function(i,s,a,l){l>0?(Qe(i,a.theme.tableFrozenColumn),s.setAttribute("data-lexical-frozen-column","true")):(Un(i,a.theme.tableFrozenColumn),s.removeAttribute("data-lexical-frozen-column"))})(n,r,o,this.__frozenColumnCount),this.__frozenRowCount!==(t?t.__frozenRowCount:0)&&(function(i,s,a,l){l>0?(Qe(i,a.theme.tableFrozenRow),s.setAttribute("data-lexical-frozen-row","true")):(Un(i,a.theme.tableFrozenRow),s.removeAttribute("data-lexical-frozen-row"))})(n,r,o,this.__frozenRowCount)}updateTableElement(t,n,r){this.__style!==(t?t.__style:"")&&(n.style.cssText=this.__style),this.__rowStriping!==(!!t&&t.__rowStriping)&&(function(o,i,s){s?(Qe(o,i.theme.tableRowStriping),o.setAttribute("data-lexical-row-striping","true")):(Un(o,i.theme.tableRowStriping),o.removeAttribute("data-lexical-row-striping"))})(n,r,this.__rowStriping),(function(o,i,s,a){const l=o.querySelector("colgroup");if(!l)return;const c=[];for(let u=0;u<s;u++){const f=document.createElement("col"),d=a&&a[u];d&&(f.style.width=`${d}px`),c.push(f)}l.replaceChildren(...c)})(n,0,this.getColumnCount(),this.getColWidths()),nv(n,r,this.getFormatType())}updateDOM(t,n,r){const o=this.getDOMSlot(n).element;return n===o===Ll()||(Be(i=n)&&i.nodeName==="DIV"&&this.updateTableWrapper(t,n,o,r),this.updateTableElement(t,o,r),!1);var i}exportDOM(t){const n=super.exportDOM(t),{element:r}=n;return{after:o=>{if(n.after&&(o=n.after(o)),!ri(o)&&Be(o)&&(o=o.querySelector("table")),!ri(o))return null;nv(o,t._config,this.getFormatType());const[i]=Nr(this,null,null),s=new Map;for(const u of i)for(const f of u){const d=f.cell.getKey();s.has(d)||s.set(d,{colSpan:f.cell.getColSpan(),startColumn:f.startColumn})}const a=new Set;for(const u of o.querySelectorAll(":scope > tr > [data-temporary-table-cell-lexical-key]")){const f=u.getAttribute("data-temporary-table-cell-lexical-key");if(f){const d=s.get(f);if(u.removeAttribute("data-temporary-table-cell-lexical-key"),d){s.delete(f);for(let h=0;h<d.colSpan;h++)a.add(h+d.startColumn)}}}const l=o.querySelector(":scope > colgroup");if(l){const u=Array.from(o.querySelectorAll(":scope > colgroup > col")).filter((f,d)=>a.has(d));l.replaceChildren(...u)}const c=o.querySelectorAll(":scope > tr");if(c.length>0){const u=document.createElement("tbody");for(const f of c)u.appendChild(f);o.append(u)}return o},element:!ri(r)&&Be(r)?r.querySelector("table"):r}}canBeEmpty(){return!1}isShadowRoot(){return!0}getCordsFromCellNode(t,n){const{rows:r,domRows:o}=n;for(let i=0;i<r;i++){const s=o[i];if(s!=null)for(let a=0;a<s.length;a++){const l=s[a];if(l==null)continue;const{elem:c}=l,u=af(this,c);if(u!==null&&t.is(u))return{x:a,y:i}}}throw new Error("Cell not found in table.")}getDOMCellFromCords(t,n,r){const{domRows:o}=r,i=o[n];if(i==null)return null;const s=i[t<i.length?t:i.length-1];return s??null}getDOMCellFromCordsOrThrow(t,n,r){const o=this.getDOMCellFromCords(t,n,r);if(!o)throw new Error("Cell not found at cords.");return o}getCellNodeFromCords(t,n,r){const o=this.getDOMCellFromCords(t,n,r);if(o==null)return null;const i=Ht(o.elem);return ge(i)?i:null}getCellNodeFromCordsOrThrow(t,n,r){const o=this.getCellNodeFromCords(t,n,r);if(!o)throw new Error("Node at cords not TableCellNode.");return o}getRowStriping(){return!!this.getLatest().__rowStriping}setRowStriping(t){const n=this.getWritable();return n.__rowStriping=t,n}setFrozenColumns(t){const n=this.getWritable();return n.__frozenColumnCount=t,n}getFrozenColumns(){return this.getLatest().__frozenColumnCount}setFrozenRows(t){const n=this.getWritable();return n.__frozenRowCount=t,n}getFrozenRows(){return this.getLatest().__frozenRowCount}canSelectBefore(){return!0}canIndent(){return!1}getColumnCount(){const t=this.getFirstChild();if(!t)return 0;let n=0;return t.getChildren().forEach(r=>{ge(r)&&(n+=r.getColSpan())}),n}}function wP(e,t){const n=e.getElementByKey(t.getKey());return n===null&&de(230),bi(t,n)}function CP(e){const t=cc();e.hasAttribute("data-lexical-row-striping")&&t.setRowStriping(!0),e.hasAttribute("data-lexical-frozen-column")&&t.setFrozenColumns(1),e.hasAttribute("data-lexical-frozen-row")&&t.setFrozenRows(1);const n=e.querySelector(":scope > colgroup");if(n){let r=[];for(const o of n.querySelectorAll(":scope > col")){let i=o.style.width||"";if(!qh.test(i)&&(i=o.getAttribute("width")||"",!/^\d+$/.test(i))){r=void 0;break}r.push(parseFloat(i))}r&&t.setColWidths(r)}return{after:r=>nw(r,et),node:t}}function cc(){return _t(new An)}function Xe(e){return e instanceof An}function SP(e){et(e.getParent())?e.isEmpty()&&e.append(ye()):e.remove()}function _P(e){Xe(e.getParent())?ew(e,ge):e.remove()}function TP(e){ew(e,et);const[t]=Nr(e,null,null),n=t.reduce((s,a)=>Math.max(s,a.length),0),r=e.getChildren();for(let s=0;s<t.length;++s){const a=r[s];if(!a)continue;et(a)||de(254,a.constructor.name,a.getType());const l=t[s].reduce((c,u)=>u?1+c:c,0);if(l!==n)for(let c=l;c<n;++c){const u=ln();u.append(ye()),a.append(u)}}const o=e.getColWidths(),i=e.getColumnCount();if(o&&o.length!==i){let s;if(i<o.length)s=o.slice(0,i);else if(o.length>0){const a=o[o.length-1];s=[...o,...Array(i-o.length).fill(a)]}e.setColWidths(s)}}function EP(e){if(e.detail<3||!xn(e.target))return!1;const t=Ht(e.target);if(t===null)return!1;const n=we(t,r=>B(r)&&!r.isInline());return n===null?!1:!!ge(n.getParent())&&(n.select(0),!0)}function RP(e){return e.registerNodeTransform(kn,t=>{if(t.getColSpan()>1||t.getRowSpan()>1){const[,,n]=jn(t),[r]=on(n,t,t),o=r.length,i=r[0].length;let s=n.getFirstChild();et(s)||de(175);const a=[];for(let l=0;l<o;l++){l!==0&&(s=s.getNextSibling(),et(s)||de(175));let c=null;for(let u=0;u<i;u++){const f=r[l][u],d=f.cell;if(f.startRow===l&&f.startColumn===u)c=d,a.push(d);else if(d.getColSpan()>1||d.getRowSpan()>1){ge(d)||de(176);const h=ln(d.__headerState);c!==null?c.insertAfter(h):JA(s,h)}}}for(const l of a)l.setColSpan(1),l.setRowSpan(1)}})}function kP(e,t=!0){const n=new Map,r=(i,s,a)=>{const l=No(i,a),c=mP(i,l,e,t);n.set(s,[c,l])},o=e.registerMutationListener(An,i=>{e.getEditorState().read(()=>{for(const[s,a]of i){const l=n.get(s);if(a==="created"||a==="updated"){const{tableNode:c,tableElement:u}=Qw(s);l===void 0?r(c,s,u):u!==l[1]&&(l[0].removeListeners(),n.delete(s),r(c,s,u))}else a==="destroyed"&&l!==void 0&&(l[0].removeListeners(),n.delete(s))}},{editor:e})},{skipInitialization:!1});return()=>{o();for(const[,[i]]of n)i.removeListeners()}}function AP(e,t){e.hasNodes([An])||de(255);const{hasNestedTables:n=iw(!1)}=t??{};return Rn(e.registerCommand(Xw,r=>(function({rows:o,columns:i,includeHeaders:s},a){const l=Y()||qn();if(!l||!W(l)||!a&&wi(l.anchor.getNode()))return!1;const c=nP(Number(o),Number(i),s);XA(c);const u=c.getFirstDescendant();return X(u)&&u.select(),!0})(r,n.peek()),be),e.registerCommand(lh,({nodes:r,selection:o},i)=>n.peek()||e!==i||!W(o)?!1:wi(o.anchor.getNode())!==null&&r.some(Xe),be),e.registerCommand(Kl,EP,be),e.registerNodeTransform(An,TP),e.registerNodeTransform(zr,_P),e.registerNodeTransform(kn,SP))}function MP({hasCellMerge:e=!0,hasCellBackgroundColor:t=!0,hasTabHandler:n=!0,hasHorizontalScroll:r=!1,hasNestedTables:o=!1}){const[i]=it();S.useEffect(()=>{Ll(i)!==r&&(bP(i,r),i.registerNodeTransform(An,()=>{})())},[i,r]);const s=S.useMemo(()=>iw(!1),[]);return s.peek()!==o&&(s.value=o),S.useEffect(()=>AP(i,{hasNestedTables:s}),[i,s]),S.useEffect(()=>kP(i,n),[i,n]),S.useEffect(()=>{if(!e)return RP(i)},[i,e]),S.useEffect(()=>{if(!t)return i.registerNodeTransform(kn,a=>{a.getBackgroundColor()!==null&&a.setBackgroundColor(null)})},[i,t,e]),null}var du,rv;function rC(){if(rv)return du;rv=1;function e(t){var n=typeof t;return t!=null&&(n=="object"||n=="function")}return du=e,du}var fu,ov;function NP(){if(ov)return fu;ov=1;var e=typeof Dn=="object"&&Dn&&Dn.Object===Object&&Dn;return fu=e,fu}var hu,iv;function oC(){if(iv)return hu;iv=1;var e=NP(),t=typeof self=="object"&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return hu=n,hu}var gu,sv;function PP(){if(sv)return gu;sv=1;var e=oC(),t=function(){return e.Date.now()};return gu=t,gu}var pu,av;function LP(){if(av)return pu;av=1;var e=/\s/;function t(n){for(var r=n.length;r--&&e.test(n.charAt(r)););return r}return pu=t,pu}var mu,lv;function FP(){if(lv)return mu;lv=1;var e=LP(),t=/^\s+/;function n(r){return r&&r.slice(0,e(r)+1).replace(t,"")}return mu=n,mu}var yu,cv;function iC(){if(cv)return yu;cv=1;var e=oC(),t=e.Symbol;return yu=t,yu}var vu,uv;function $P(){if(uv)return vu;uv=1;var e=iC(),t=Object.prototype,n=t.hasOwnProperty,r=t.toString,o=e?e.toStringTag:void 0;function i(s){var a=n.call(s,o),l=s[o];try{s[o]=void 0;var c=!0}catch{}var u=r.call(s);return c&&(a?s[o]=l:delete s[o]),u}return vu=i,vu}var xu,dv;function OP(){if(dv)return xu;dv=1;var e=Object.prototype,t=e.toString;function n(r){return t.call(r)}return xu=n,xu}var bu,fv;function IP(){if(fv)return bu;fv=1;var e=iC(),t=$P(),n=OP(),r="[object Null]",o="[object Undefined]",i=e?e.toStringTag:void 0;function s(a){return a==null?a===void 0?o:r:i&&i in Object(a)?t(a):n(a)}return bu=s,bu}var wu,hv;function DP(){if(hv)return wu;hv=1;function e(t){return t!=null&&typeof t=="object"}return wu=e,wu}var Cu,gv;function jP(){if(gv)return Cu;gv=1;var e=IP(),t=DP(),n="[object Symbol]";function r(o){return typeof o=="symbol"||t(o)&&e(o)==n}return Cu=r,Cu}var Su,pv;function VP(){if(pv)return Su;pv=1;var e=FP(),t=rC(),n=jP(),r=NaN,o=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,s=/^0o[0-7]+$/i,a=parseInt;function l(c){if(typeof c=="number")return c;if(n(c))return r;if(t(c)){var u=typeof c.valueOf=="function"?c.valueOf():c;c=t(u)?u+"":u}if(typeof c!="string")return c===0?c:+c;c=e(c);var f=i.test(c);return f||s.test(c)?a(c.slice(2),f?2:8):o.test(c)?r:+c}return Su=l,Su}var _u,mv;function BP(){if(mv)return _u;mv=1;var e=rC(),t=PP(),n=VP(),r="Expected a function",o=Math.max,i=Math.min;function s(a,l,c){var u,f,d,h,g,p,m=0,x=!1,y=!1,v=!0;if(typeof a!="function")throw new TypeError(r);l=n(l)||0,e(c)&&(x=!!c.leading,y="maxWait"in c,d=y?o(n(c.maxWait)||0,l):d,v="trailing"in c?!!c.trailing:v);function b(I){var $=u,H=f;return u=f=void 0,m=I,h=a.apply(H,$),h}function w(I){return m=I,g=setTimeout(T,l),x?b(I):h}function _(I){var $=I-p,H=I-m,U=l-$;return y?i(U,d-H):U}function E(I){var $=I-p,H=I-m;return p===void 0||$>=l||$<0||y&&H>=d}function T(){var I=t();if(E(I))return k(I);g=setTimeout(T,_(I))}function k(I){return g=void 0,v&&u?b(I):(u=f=void 0,h)}function P(){g!==void 0&&clearTimeout(g),m=0,u=p=f=g=void 0}function O(){return g===void 0?h:k(t())}function D(){var I=t(),$=E(I);if(u=arguments,f=this,p=I,$){if(g===void 0)return w(p);if(y)return clearTimeout(g),g=setTimeout(T,l),b(p)}return g===void 0&&(g=setTimeout(T,l)),h}return D.cancel=P,D.flush=O,D}return _u=s,_u}var zP=BP();const HP=_f(zP),WP=e=>M.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("path",{d:"M1.61342 8.47549C1.52262 8.33173 1.47723 8.25985 1.45182 8.14898C1.43273 8.06571 1.43273 7.93437 1.45182 7.8511C1.47723 7.74023 1.52262 7.66835 1.61341 7.52459C2.36369 6.3366 4.59693 3.33337 8.00027 3.33337C11.4036 3.33337 13.6369 6.3366 14.3871 7.52459C14.4779 7.66835 14.5233 7.74023 14.5487 7.8511C14.5678 7.93437 14.5678 8.06571 14.5487 8.14898C14.5233 8.25985 14.4779 8.33173 14.3871 8.47549C13.6369 9.66348 11.4036 12.6667 8.00027 12.6667C4.59693 12.6667 2.36369 9.66348 1.61342 8.47549Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),M.createElement("path",{d:"M8.00027 10C9.10484 10 10.0003 9.10461 10.0003 8.00004C10.0003 6.89547 9.10484 6.00004 8.00027 6.00004C6.8957 6.00004 6.00027 6.89547 6.00027 8.00004C6.00027 9.10461 6.8957 10 8.00027 10Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),sC=e=>M.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("path",{d:"M16 6V5.2C16 4.0799 16 3.51984 15.782 3.09202C15.5903 2.71569 15.2843 2.40973 14.908 2.21799C14.4802 2 13.9201 2 12.8 2H11.2C10.0799 2 9.51984 2 9.09202 2.21799C8.71569 2.40973 8.40973 2.71569 8.21799 3.09202C8 3.51984 8 4.0799 8 5.2V6M10 11.5V16.5M14 11.5V16.5M3 6H21M19 6V17.2C19 18.8802 19 19.7202 18.673 20.362C18.3854 20.9265 17.9265 21.3854 17.362 21.673C16.7202 22 15.8802 22 14.2 22H9.8C8.11984 22 7.27976 22 6.63803 21.673C6.07354 21.3854 5.6146 20.9265 5.32698 20.362C5 19.7202 5 18.8802 5 17.2V6",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}));function aC(e){return e instanceof Po}function lC(e){return new Po(e)}const{color:Ni,cornerRadius:KP,spacing:UP,transition:GP}=j,qP=R.css({display:"inline-flex",color:Ni.text.accent,textDecoration:"underline",cursor:"pointer"}),YP=R.css({color:Ni.text.accent,":hover":{color:Ni.text.accentHover}}),XP=R.css({width:"16px",height:"16px",color:Ni.icon.negative,cursor:"pointer",transition:GP.general,":hover":{color:Ni.icon.negativeHover}}),ZP=R.css({boxShadow:`0 2px 10px 4px ${Ni.effect.shadowL}`,borderRadius:KP.md,padding:UP.sm});function JP({url:e,text:t,nodeKey:n}){const[r]=it(),{isEditable:o}=Gs(),i=S.useCallback(()=>{r.update(()=>{const s=Le(n);aC(s)&&s.remove()})},[r,n]);return C.jsx(Lr,{content:C.jsxs(G,{flex:!0,row:!0,center:!0,gap:"var(--spacing-xs)",children:[C.jsx("a",{className:YP,target:"_blank",href:e,children:e}),o&&C.jsx(sC,{className:XP,onClick:i})]}),placement:"right-start",trigger:"hover",contentClassName:ZP,children:C.jsx(se,{className:qP,children:t})})}const Tu="custom-link-node";class Po extends Zs{_url;_text;constructor({url:t,text:n},r){super(r),this._url=t,this._text=n}getType(){return Tu}getData(){return{url:this._url,text:this._text}}isInline(){return!0}isIsolated(){return!1}createDOM(){const t=document.createElement("span");return t.style.display="inline",t}updateDOM(){return!1}decorate(){return C.jsx(JP,{...this.getData(),nodeKey:this.getKey()})}exportJSON(){return{...super.exportJSON(),format:"left",type:Tu,version:1,text:this._text,url:this._url}}static importJSON(t){return new Po({url:t.url,text:t.text})}static getType(){return Tu}static clone(t){return new Po({url:t._url,text:t._text},t.__key)}}const QP={type:"text-match",dependencies:[Po],regExp:/\[([^\]]+)]\(([^)]+)\)/,trigger:")",importRegExp:/\[([^\]]+)]\(([^)]+)\)/,replace:(e,t)=>{const[,n,r]=t,o=lC({url:r,text:n});e.replace(o)},export:e=>{if(!aC(e))return null;const{text:n,url:r}=e.getData();return!r||!n?"":`[${n}](${r})`}},yv="image-row",e6=R.css({width:"fit-content",display:"flex",alignItems:"center"});function cC(e){return e.length?new Hr(e):null}function uC(e){return e instanceof Hr}const{color:cf,cornerRadius:dC,spacing:t6,transition:n6}=j,r6=R.css({width:"100px",height:"100px",objectFit:"cover",borderRadius:dC.md}),o6=R.css({width:"20px",height:"20px",color:cf.icon.negative,cursor:"pointer",transition:n6.general,":hover":{color:cf.icon.negativeHover}}),i6=R.css({boxShadow:`0 2px 10px 4px ${cf.effect.shadowL}`,borderRadius:dC.xs,padding:t6.xs}),{spacing:s6}=j;function a6({images:e,nodeKey:t}){const[n]=it(),{isEditable:r}=Gs(),o=S.useCallback(()=>{n.update(()=>{const i=Le(t);uC(i)&&i.remove()})},[n,t]);return C.jsx(Lr,{open:r?void 0:!1,content:C.jsx(sC,{className:o6,onClick:o}),placement:"right-start",trigger:"hover",contentClassName:i6,children:C.jsx(G,{w:"full",flex:!0,row:!0,gap:s6.sm,alignItems:"center",children:e.map(({src:i,alt:s})=>C.jsx("img",{src:i,alt:s??"",className:r6},i))})})}class Hr extends Zs{images;constructor(t,n){super(n),this.images=t}createDOM(){const t=document.createElement("div");return t.className=e6,t.contentEditable="false",t}updateDOM(){return!1}decorate(){return C.jsx(a6,{images:this.images,nodeKey:this.getKey()})}exportJSON(){return{...super.exportJSON(),format:"left",type:yv,version:1,images:this.images}}static importJSON(t){return new Hr(t.images)}isInline(){return!1}isIsolated(){return!0}isSelectable(){return!0}static getType(){return yv}static clone(t){return new Hr(t.images,t.__key)}}const l6={type:"element",dependencies:[Hr],regExp:/^!\[[^\]]*]\([^)]+\)(?:\s+!\[[^\]]*]\([^)]+\))*$/,replace:(e,t,n)=>{const[r]=n,i=[...r.matchAll(/!\[([^\]]*)]\(([^)]+)\)/g)].map(([a,l,c])=>({alt:l,src:c})),s=cC(i);s&&xh([s])},export:e=>{if(!(e instanceof Hr))return null;const n=e.images;return n.length?n.map(({src:r,alt:o})=>`![${o}](${r})`).join(" "):""}},c6=e=>M.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("g",null,M.createElement("path",{d:"M8.00008 8.66634C8.36827 8.66634 8.66675 8.36786 8.66675 7.99967C8.66675 7.63148 8.36827 7.33301 8.00008 7.33301C7.63189 7.33301 7.33341 7.63148 7.33341 7.99967C7.33341 8.36786 7.63189 8.66634 8.00008 8.66634Z",fill:"currentColor"}),M.createElement("path",{d:"M12.6667 8.66634C13.0349 8.66634 13.3334 8.36786 13.3334 7.99967C13.3334 7.63148 13.0349 7.33301 12.6667 7.33301C12.2986 7.33301 12.0001 7.63148 12.0001 7.99967C12.0001 8.36786 12.2986 8.66634 12.6667 8.66634Z",fill:"currentColor"}),M.createElement("path",{d:"M3.33341 8.66634C3.7016 8.66634 4.00008 8.36786 4.00008 7.99967C4.00008 7.63148 3.7016 7.33301 3.33341 7.33301C2.96522 7.33301 2.66675 7.63148 2.66675 7.99967C2.66675 8.36786 2.96522 8.66634 3.33341 8.66634Z",fill:"currentColor"}),M.createElement("path",{d:"M8.00008 8.66634C8.36827 8.66634 8.66675 8.36786 8.66675 7.99967C8.66675 7.63148 8.36827 7.33301 8.00008 7.33301C7.63189 7.33301 7.33341 7.63148 7.33341 7.99967C7.33341 8.36786 7.63189 8.66634 8.00008 8.66634Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),M.createElement("path",{d:"M12.6667 8.66634C13.0349 8.66634 13.3334 8.36786 13.3334 7.99967C13.3334 7.63148 13.0349 7.33301 12.6667 7.33301C12.2986 7.33301 12.0001 7.63148 12.0001 7.99967C12.0001 8.36786 12.2986 8.66634 12.6667 8.66634Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),M.createElement("path",{d:"M3.33341 8.66634C3.7016 8.66634 4.00008 8.36786 4.00008 7.99967C4.00008 7.63148 3.7016 7.33301 3.33341 7.33301C2.96522 7.33301 2.66675 7.63148 2.66675 7.99967C2.66675 8.36786 2.96522 8.66634 3.33341 8.66634Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),M.createElement("defs",null)),{color:vv}=j,u6=R.css({cursor:"pointer"}),d6=R.css({":hover":{backgroundColor:vv.fill.bgSecondary},":active":{backgroundColor:vv.fill.bgSecondary}}),{color:xv,spacing:bv}=j;function f6({groups:e,toolbarVisibleActionsCount:t,onAction:n,disabled:r}){const[o,i]=S.useState(!1),s=S.useCallback(c=>()=>{r||(c&&c(),i(!1))},[r]),a=S.useCallback(({IconComponent:c,...u},f)=>C.jsxs(G,{className:R.cx(u6,!r&&d6),p:bv.sm,alignItems:"center",flex:!0,row:!0,gap:bv.xs,onClick:s(()=>n(u.id,f)),children:[C.jsx(c,{width:20,height:20,color:xv.icon.tertiary}),C.jsx(se,{variant:"body-2",children:u.label})]},u.id),[r,n,s]),l=S.useMemo(()=>e.map((c,u)=>{const f=u===e.length-1;if(!c.length)return null;const d=c.map((h,g)=>{const m=(u?e.slice(0,u).flat().length:0)+g+t;return a(h,m)});return C.jsxs(S.Fragment,{children:[d,f?null:C.jsx(G,{w:"full",h:1,backgroundColor:xv.border.neutralAlphaBasic})]},c.flatMap(h=>h.id).join("-"))}),[e,a,t]);return C.jsx(Lr,{content:C.jsx(G,{flex:!0,children:l}),placement:"bottom",open:o,onChange:i,children:C.jsx(fr,{size:"xs",color:"no-bg",disabled:r,children:C.jsx(c6,{})})})}const h6=R.css({minWidth:"fit-content"}),g6=e=>{throw new Error("defaultOnImagesUpload function must be overridden")},{spacing:wv}=j;function Cv({onSave:e}){const[t,n]=S.useState(""),[r,o]=S.useState(""),[i,s]=S.useState(null),a=qs(),{textPlaceholder:l,linkPlaceholder:c,linkErrorText:u,buttonText:f}=a.toolbar.link,d=S.useMemo(()=>i==="link"?u:null,[i,u]),h=S.useCallback(v=>{try{const b=new URL(v);if(!(b.protocol==="http:"||b.protocol==="https:"))throw new Error("Invalid protocol");return s(null),!0}catch{return s("link"),!1}},[]),g=S.useCallback(v=>{n(v.target.value)},[]),p=S.useCallback(v=>{h(v.target.value),o(v.target.value)},[h]),m=S.useCallback(()=>[()=>h(r)].map(w=>w()).every(Boolean),[r,h]),x=S.useCallback(()=>{n(""),o(""),s(null)},[]),y=S.useCallback(v=>{v.preventDefault(),m()&&(e({text:t||r,url:r}),x())},[r,e,t,m,x]);return S.useEffect(()=>()=>{x()},[]),C.jsx("form",{onSubmit:y,children:C.jsxs(G,{flex:!0,alignItems:"flex-start",p:wv.sm,gap:wv.sm,children:[C.jsx(G,{children:C.jsx(Ei,{placeholder:l,size:"sm",value:t,onChange:g})}),C.jsx(G,{children:C.jsx(Ei,{placeholder:c,size:"sm",value:r,onChange:p,error:!!d,errorText:d||""})}),C.jsx(Ti,{size:"xs",width:"auto",type:"submit",children:f})]})})}const Sv=50,_v=20,Tv=1,Ev=1;function Rv({onSave:e}){const[t,n]=S.useState(""),[r,o]=S.useState(""),[i,s]=S.useState(null),[a,l]=S.useState(null),c=qs(),{maxRowsErrorText:u,maxColumnsErrorText:f,minRowsErrorText:d,minColumnsErrorText:h,rowsPlaceholder:g,columnsPlaceholder:p,buttonText:m}=c.toolbar.table,x=S.useMemo(()=>{switch(i){case"rows-max":return u({current:Number(t),limit:Sv});case"rows-min":return d({current:Number(t),limit:Tv});default:return null}},[i,t,u,d]),y=S.useMemo(()=>{switch(a){case"columns-max":return f({current:Number(r),limit:_v});case"columns-min":return h({current:Number(r),limit:Ev});default:return null}},[a,r,f,h]),v=S.useCallback(O=>{try{const D=Number(O);if(D>Sv)throw s("rows-max"),new Error("Rows amount exceeds maximum");if(D<Tv)throw s("rows-min"),new Error("Rows amount below minimum");return s(null),!0}catch{return!1}},[]),b=S.useCallback(O=>{try{const D=Number(O);if(D>_v)throw l("columns-max"),new Error("Columns amount exceeds maximum");if(D<Ev)throw l("columns-min"),new Error("Columns amount below minimum");return l(null),!0}catch{return!1}},[]),w=S.useCallback(O=>{const D=Number(O);return!Number.isNaN(D)&&Number.isInteger(D)?D:null},[]),_=S.useCallback(O=>{const D=O.target.value,I=w(D);typeof I=="number"&&(v(D),n(String(I)))},[v,w]),E=S.useCallback(O=>{const D=O.target.value,I=w(D);typeof I=="number"&&(b(D),o(String(I)))},[b,w]),T=S.useCallback(()=>[()=>v(t),()=>b(r)].map(I=>I()).every(Boolean),[r,t,b,v]),k=S.useCallback(()=>{n(""),o(""),s(null),l(null)},[]),P=S.useCallback(O=>{O.preventDefault(),T()&&(e({rows:t,columns:r}),k())},[r,e,t,T,k]);return S.useEffect(()=>()=>{k()},[]),C.jsx("form",{onSubmit:P,children:C.jsxs(G,{flex:!0,alignItems:"flex-start",p:"var(--spacing-sm)",gap:"var(--spacing-sm)",children:[C.jsx(G,{children:C.jsx(Ei,{placeholder:g,size:"sm",value:t,onChange:_,error:!!x,errorText:x||""})}),C.jsx(G,{children:C.jsx(Ei,{placeholder:p,size:"sm",value:r,onChange:E,error:!!y,errorText:y||""})}),C.jsx(Ti,{size:"xs",width:"auto",type:"submit",children:m})]})})}function p6({disabled:e=!1}){const[t,n]=S.useState(null),[r]=it(),o=qs(),i=S.useMemo(()=>{const l=o.toolbar.textSize;return[{value:"paragraph",label:l.paragraph,textProps:{variant:"body-2"}},{value:"h1",label:l.h1,textProps:{fontWeight:"semibold",variant:"headline-1"}},{value:"h2",label:l.h2,textProps:{fontWeight:"semibold",variant:"headline-2"}},{value:"h3",label:l.h3,textProps:{fontWeight:"semibold",variant:"headline-3"}}]},[o.toolbar.textSize]),s=S.useCallback(l=>{!l||Array.isArray(l)||r.update(()=>{const c=Y();if(!W(c))return;const u=c.anchor.getNode().getTopLevelElement();if(!u)return;const f=l==="paragraph"?ye():go(l);u.getChildren().forEach(d=>{f.append(d)}),u.replace(f),f.selectEnd()})},[r]),a=S.useCallback(()=>{const l=Y();if(!W(l))return null;const c=l.anchor.getNode().getTopLevelElement();return Rw(c)?c.getTag():"paragraph"},[]);return S.useEffect(()=>{const l=r.registerUpdateListener(({editorState:c})=>{c.read(()=>{const u=a();u&&n(u)})});return()=>{l()}},[r,a]),C.jsx(gg,{size:"xs",items:i,renderDropdownItem:l=>C.jsx(se,{whiteSpace:"nowrap",...l.textProps,children:l.label}),returnedValue:l=>l.value,renderSingleInputItem:l=>l.label,onChange:s,disabled:e,value:t,showDefaultItem:!1})}const{color:is,cornerRadius:m6,spacing:Eu}=j;function y6({onImagesUpload:e=g6}){const[t,n]=S.useState(11),[r,o]=S.useState(null),[i,s]=S.useState(null),a=S.useRef(null),{toolbar:l}=qs(),c=l.preview,[u]=it(),{isEditable:f,isPreviewMode:d,setPreviewMode:h}=Gs(),{availableActionGroups:g}=eM(),p=S.useRef(null),m=S.useMemo(()=>!f||d,[f,d]),x=S.useMemo(()=>d?c.hide:c.show,[d,c]),{toolbarGroups:y,menuGroups:v}=S.useMemo(()=>{const $=[],H=[];let U=0;for(const L of g){const N=[],V=[];for(const K of L)U+=1,U<=t?N.push(K):V.push(K);N.length&&$.push(N),V.length&&H.push(V)}return{toolbarGroups:$,menuGroups:H}},[g,t]),b=S.useMemo(()=>typeof r=="number"&&r>t-1,[r,t]),w=S.useMemo(()=>typeof i=="number"&&i>t-1,[i,t]),_=S.useCallback($=>{const{text:H,url:U}=$;u.update(()=>{const L=Y();if(W(L)){const N=lC({text:H,url:U});L.insertNodes([N]);const V=Fe(" ");N.insertAfter(V),V.select()}}),o(null)},[u]),E=S.useCallback($=>{const{rows:H,columns:U}=$;u.dispatchCommand(Xw,{rows:H,columns:U}),s(null)},[u]),T=S.useCallback(()=>{p.current&&p.current.click()},[]),k=S.useCallback(async $=>{try{const H=Array.from($.target.files||[]);if(!H.length)return;const U=await e(H);u.update(()=>{const L=cC(U);L&&xh([L])})}catch(H){console.error("Error uploading images:",H)}finally{$.target.value=""}},[u,e]),P=S.useCallback(($,H)=>{({[ie.BOLD]:()=>{u.dispatchCommand(It,"bold")},[ie.ITALIC]:()=>{u.dispatchCommand(It,"italic")},[ie.UNDERLINE]:()=>{u.dispatchCommand(It,"underline")},[ie.STRIKETHROUGH]:()=>{u.dispatchCommand(It,"strikethrough")},[ie.ALIGN_LEFT]:()=>{u.dispatchCommand(pi,"left")},[ie.ALIGN_CENTER]:()=>{u.dispatchCommand(pi,"center")},[ie.ALIGN_RIGHT]:()=>{u.dispatchCommand(pi,"right")},[ie.LINK]:()=>{o(H)},[ie.IMAGE]:()=>{T()},[ie.TABLE]:()=>{s(H)},[ie.BULLET_LIST]:()=>{u.dispatchCommand(yw,void 0)},[ie.NUMBERED_LIST]:()=>{u.dispatchCommand(vw,void 0)}})[$]()},[T,u]),O=S.useMemo(()=>y.map(($,H)=>{const U=y.slice(0,H).reduce((V,K)=>V+K.length,0);if(!$.length)return null;const L=$.map(({IconComponent:V,isActive:K,id:te},J)=>{const Z=U+J,ae=K?"neutral":"no-bg";return te===ie.LINK?C.jsx(Lr,{content:C.jsx(Cv,{onSave:_}),placement:"bottom",open:r===Z,onChange:oe=>{o(oe?Z:null)},children:C.jsx(fr,{size:"xs",color:"no-bg",disabled:m,children:C.jsx(V,{})})},te):te===ie.TABLE?C.jsx(Lr,{content:C.jsx(Rv,{onSave:E}),placement:"bottom",open:i===Z,onChange:oe=>{s(oe?Z:null)},children:C.jsx(fr,{size:"xs",color:ae,disabled:m,children:C.jsx(V,{})})},te):C.jsx(fr,{size:"xs",color:ae,onClick:()=>P(te,Z),disabled:m,children:C.jsx(V,{})},te)});return L.every(V=>!V)?null:C.jsxs(S.Fragment,{children:[L,C.jsx(G,{w:1,h:32,backgroundColor:is.border.neutralAlphaBasic})]},$.flatMap(V=>V.id).join("-"))}),[y,P,r,m,i,_,E]),D=S.useCallback(()=>{const $=a.current;if(!$)return;const H=$.clientWidth,U=40,L=4,N=1,V=L+N+L+U+L;let K=H-V,te=0;for(const J of g)if(J.length){for(const Z of J){const ae=U+L;if(K-ae>=0)K-=ae,te+=1;else break}K-=N+L}n(te)},[g]),I=S.useMemo(()=>HP(D,20,{}),[D]);return S.useEffect(()=>{if(!a.current)return;const $=new ResizeObserver(()=>{I()});return $.observe(a.current),()=>$.disconnect()},[I]),C.jsxs(G,{backgroundColor:is.fill.neutralPrimary,border:`1px solid ${is.border.neutralAlphaBasic}`,borderRadius:m6.md,flex:!0,row:!0,alignItems:"center",justifyContent:"space-between",p:Eu.sm,children:[C.jsxs(G,{flex:!0,flexGrow:1,row:!0,alignItems:"center",overflow:"hidden",children:[C.jsx("input",{ref:p,type:"file",accept:"image/*",hidden:!0,multiple:!0,onChange:k,disabled:m}),C.jsx(p6,{disabled:m}),C.jsx(Lr,{content:C.jsx(Cv,{onSave:_}),placement:"bottom",open:b,onChange:$=>{$||o(null)},children:C.jsx("div",{})}),C.jsx(Lr,{content:C.jsx(Rv,{onSave:E}),placement:"bottom",open:w,onChange:$=>{$||s(null)},children:C.jsx("div",{})}),C.jsxs(G,{flex:!0,row:!0,alignItems:"center",gap:Eu.xs,w:"full",ml:Eu.xs,overflow:"hidden",ref:a,children:[O,v.length?C.jsx(f6,{disabled:m,onAction:P,groups:v,toolbarVisibleActionsCount:t}):null]})]}),C.jsx(Ti,{width:"auto",size:"xs",color:d?"accent":"neutral",intensity:"secondary",wrapperClassName:h6,onClick:()=>{h($=>!$)},iconLeft:C.jsx(WP,{color:d?is.icon.accent:is.icon.secondary}),children:x})]})}const fC=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?S.useLayoutEffect:S.useEffect;function v6({editor:e,ariaActiveDescendant:t,ariaAutoComplete:n,ariaControls:r,ariaDescribedBy:o,ariaErrorMessage:i,ariaExpanded:s,ariaInvalid:a,ariaLabel:l,ariaLabelledBy:c,ariaMultiline:u,ariaOwns:f,ariaRequired:d,autoCapitalize:h,className:g,id:p,role:m="textbox",spellCheck:x=!0,style:y,tabIndex:v,"data-testid":b,...w},_){const[E,T]=S.useState(e.isEditable()),k=S.useCallback(O=>{O&&O.ownerDocument&&O.ownerDocument.defaultView?e.setRootElement(O):e.setRootElement(null)},[e]),P=S.useMemo(()=>(function(...O){return D=>{for(const I of O)typeof I=="function"?I(D):I!=null&&(I.current=D)}})(_,k),[k,_]);return fC(()=>(T(e.isEditable()),e.registerEditableListener(O=>{T(O)})),[e]),C.jsx("div",{"aria-activedescendant":E?t:void 0,"aria-autocomplete":E?n:"none","aria-controls":E?r:void 0,"aria-describedby":o,...i!=null?{"aria-errormessage":i}:{},"aria-expanded":E&&m==="combobox"?!!s:void 0,...a!=null?{"aria-invalid":a}:{},"aria-label":l,"aria-labelledby":c,"aria-multiline":u,"aria-owns":E?f:void 0,"aria-readonly":!E||void 0,"aria-required":d,autoCapitalize:h,className:g,contentEditable:E,"data-testid":b,id:p,ref:P,role:m,spellCheck:x,style:y,tabIndex:v,...w})}const x6=S.forwardRef(v6);function kv(e){return e.getEditorState().read(Kw(e.isComposing()))}const hC=S.forwardRef(b6);function b6(e,t){const{placeholder:n,...r}=e,[o]=it();return C.jsxs(C.Fragment,{children:[C.jsx(x6,{editor:o,...r,ref:t}),n!=null&&C.jsx(w6,{editor:o,content:n})]})}function w6({content:e,editor:t}){const n=(function(s){const[a,l]=S.useState(()=>kv(s));return fC(()=>{function c(){const u=kv(s);l(u)}return c(),Rn(s.registerUpdateListener(()=>{c()}),s.registerEditableListener(()=>{c()}))},[s]),a})(t),[r,o]=S.useState(t.isEditable());if(S.useLayoutEffect(()=>(o(t.isEditable()),t.registerEditableListener(s=>{o(s)})),[t]),!n)return null;let i=null;return typeof e=="function"?i=e(r):e!==null&&(i=e),i===null?null:C.jsx("div",{"aria-hidden":!0,children:i})}const C6=S.createContext(null),Ru={didCatch:!1,error:null};class S6 extends S.Component{constructor(t){super(t),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=Ru}static getDerivedStateFromError(t){return{didCatch:!0,error:t}}resetErrorBoundary(...t){const{error:n}=this.state;n!==null&&(this.props.onReset?.({args:t,reason:"imperative-api"}),this.setState(Ru))}componentDidCatch(t,n){this.props.onError?.(t,n)}componentDidUpdate(t,n){const{didCatch:r}=this.state,{resetKeys:o}=this.props;r&&n.error!==null&&_6(t.resetKeys,o)&&(this.props.onReset?.({next:o,prev:t.resetKeys,reason:"keys"}),this.setState(Ru))}render(){const{children:t,fallbackRender:n,FallbackComponent:r,fallback:o}=this.props,{didCatch:i,error:s}=this.state;let a=t;if(i){const l={error:s,resetErrorBoundary:this.resetErrorBoundary};if(typeof n=="function")a=n(l);else if(r)a=S.createElement(r,l);else if(o!==void 0)a=o;else throw s}return S.createElement(C6.Provider,{value:{didCatch:i,error:s,resetErrorBoundary:this.resetErrorBoundary}},a)}}function _6(e=[],t=[]){return e.length!==t.length||e.some((n,r)=>!Object.is(n,t[r]))}function gC({children:e,onError:t}){return C.jsx(S6,{fallback:C.jsx("div",{style:{border:"1px solid #f00",color:"#f00",padding:"8px"},children:"An error was thrown."}),onError:t,children:e})}const T6=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?S.useLayoutEffect:S.useEffect;function E6(e){return{initialValueFn:()=>e.isEditable(),subscribe:t=>e.registerEditableListener(t)}}function R6(){return(function(e){const[t]=it(),n=S.useMemo(()=>e(t),[t,e]),[r,o]=S.useState(()=>n.initialValueFn()),i=S.useRef(r);return T6(()=>{const{initialValueFn:s,subscribe:a}=n,l=s();return i.current!==l&&(i.current=l,o(l)),a(c=>{i.current=c,o(c)})},[n,e]),r})(E6)}const k6={name:"@lexical/react/ReactProvider"};function A6(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const o of t)r.append("v",o);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const Jh=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?S.useLayoutEffect:S.useEffect;function M6({editor:e,ErrorBoundary:t}){return(function(n,r){const[o,i]=S.useState(()=>n.getDecorators());return Jh(()=>n.registerDecoratorListener(s=>{Rs.flushSync(()=>{i(s)})}),[n]),S.useEffect(()=>{i(n.getDecorators())},[n]),S.useMemo(()=>{const s=[],a=Object.keys(o);for(let l=0;l<a.length;l++){const c=a[l],u=C.jsx(r,{onError:d=>n._onError(d),children:C.jsx(S.Suspense,{fallback:null,children:o[c]})}),f=n.getElementByKey(c);f!==null&&s.push(Rs.createPortal(u,f,c))}return s},[r,o,n])})(e,t)}function N6({editor:e,ErrorBoundary:t}){return(function(n){const r=dM.maybeFromEditor(n);if(r&&r.hasExtensionByName(k6.name)){for(const o of["@lexical/plain-text","@lexical/rich-text"])r.hasExtensionByName(o)&&A6(320,o);return!0}return!1})(e)?null:C.jsx(M6,{editor:e,ErrorBoundary:t})}function Av(e){return e.getEditorState().read(Kw(e.isComposing()))}function pC({contentEditable:e,placeholder:t=null,ErrorBoundary:n}){const[r]=it();return(function(o){Jh(()=>Rn(BM(o),LM(o)),[o])})(r),C.jsxs(C.Fragment,{children:[e,C.jsx(P6,{content:t}),C.jsx(N6,{editor:r,ErrorBoundary:n})]})}function P6({content:e}){const[t]=it(),n=(function(o){const[i,s]=S.useState(()=>Av(o));return Jh(()=>{function a(){const l=Av(o);s(l)}return a(),Rn(o.registerUpdateListener(()=>{a()}),o.registerEditableListener(()=>{a()}))},[o]),i})(t),r=R6();return n?typeof e=="function"?e(r):e:null}const L6=R.css({width:"100%"}),F6=R.css({pointerEvents:"none"});function $6(e){const{placeholder:t}=e||{},n=S.useRef(null),{alignment:r}=ow(),o=S.useCallback(s=>{if(!t)return null;const a=typeof t=="string"||typeof t=="object"&&t.hasWrapper,l=typeof t=="string"?t:t.renderContent(s);return a?C.jsx(se,{variant:"body-2",colorName:"tertiary",children:l}):C.jsx(C.Fragment,{children:l})},[t]),i=S.useCallback(s=>{const a=o(s);if(!a)return null;const l={left:"flex-start",center:"center",right:"flex-end"};return C.jsx(G,{absolute:!0,w:"full",top:0,left:0,alignItems:l[r],className:F6,children:a})},[o,r]);return C.jsx(G,{relative:!0,row:!0,w:"full",flexGrow:1,children:C.jsx(pC,{contentEditable:C.jsx(hC,{ref:n,className:L6,"aria-placeholder":"markdown editor",placeholder:i}),ErrorBoundary:gC})})}const{color:O6,spacing:I6}=j,D6=R.css({counterReset:"line"}),j6=R.css({display:"grid",gridTemplateColumns:"3ch 1fr",columnGap:I6.sm,whiteSpace:"pre-wrap",":before":{counterIncrement:"line",content:"counter(line)",color:O6.text.accent,userSelect:"none",textAlign:"right"}});function V6(){const{markdownText:e}=Gs(),t=e.split(`
65
- `);return C.jsx("pre",{className:D6,children:t.map((n,r)=>C.jsx(se,{tag:"span",className:j6,children:n||" "},r))})}const qo={text:R.css({fontFamily:"Inter, sans-serif"}),paragraph:R.css({...me.body2}),h1:R.css({...me.headline1}),h2:R.css({...me.headline2}),h3:R.css({...me.headline3}),h4:R.css({...me.body2})},{color:Qh,spacing:Mv}=j,B6=R.css({borderSpacing:"0",borderCollapse:"separate"}),z6=R.css({border:`1px solid ${Qh.border.neutralPrimary}`,padding:`${Mv.sm} ${Mv.sm}`}),H6=R.css({color:Qh.text.accent}),W6=R.css({fontWeight:"bold"}),K6=R.css({textDecoration:"underline"}),U6=R.css({textDecoration:"line-through"}),G6=R.css({textDecoration:"underline line-through"}),q6=R.css({fontStyle:"italic"}),Y6=R.css({color:Qh.text.accent,textDecoration:"underline"}),X6={table:B6,tableCell:z6,hashtag:H6,link:Y6,text:{base:qo.text,bold:W6,underline:K6,strikethrough:U6,underlineStrikethrough:G6,italic:q6},heading:{h1:qo.h1,h2:qo.h2,h3:qo.h3,h4:qo.h4},paragraph:qo.paragraph};function mC(){return{namespace:"ui-kit-markdown-text-editor",nodes:[Io,un,jo,Xr,An,kn,zr,Hr,Po,ac,ic,oc,sc,ra,oa],onError(e){throw e},theme:X6}}const Z6=[[ie.BOLD,ie.ITALIC,ie.UNDERLINE,ie.STRIKETHROUGH],[ie.LINK,ie.IMAGE],[ie.ALIGN_LEFT,ie.ALIGN_CENTER,ie.ALIGN_RIGHT],[ie.TABLE],[ie.BULLET_LIST,ie.NUMBERED_LIST]];function J6(){const[e]=it(),{isEditable:t}=Gs();return S.useEffect(()=>{e.setEditable(t)},[e,t]),null}function Q6(){const[e]=it();return S.useEffect(()=>{const t=e.registerCommand(Ul,()=>{const n=Y();if(!W(n)||!n.isCollapsed()||n.anchor.offset!==0)return!1;const o=n.anchor.getNode().getTopLevelElement();if(!o||o.getType()!=="paragraph"||o.getTextContent()!=="")return!1;const i=o.getPreviousSibling();return uC(i)?(i.remove(),o.select(),!0):!1},$t);return()=>{t()}},[e]),null}const eL=/^\|(.+)\|$/,tL=/^\|\s*:?-+:?\s*(\|\s*:?-+:?\s*)+\|$/,nL=/^\|(.+)\|$/,rL={type:"multiline-element",dependencies:[An,zr,kn],regExpStart:eL,handleImportAfterStartMatch({lines:e,rootNode:t,startLineIndex:n}){const r=e[n+1];if(!tL.test(r??""))return null;const o=cc();let i=n;for(;i<e.length&&nL.test(e[i]);){if(i===n+1){i++;continue}const s=Mi(),a=e[i].slice(1,-1).split("|").map(c=>c.trim()),l=i===n;a.forEach(c=>{const u=ln(l?rt.ROW:void 0);u.append(Fe(c)),s.append(u)}),o.append(s),i++}return t.append(o),[!0,i-1]},replace(){return!0},export(e){if(!(e instanceof An))return null;const n=e.getChildren();if(!n.length)return"";const r=[];return n.forEach((o,i)=>{if(!(o instanceof zr))return;const a=o.getChildren().map(l=>l instanceof kn?l.getTextContent().replace(/\n/g," ").trim():"");r.push(`| ${a.join(" | ")} |`),i||r.push(`| ${a.map(()=>"---").join(" | ")} |`)}),r.join(`
66
- `)}},Fl=[rL,l6,QP,...ia];function oL({defaultValue:e}){const[t]=it();return S.useEffect(()=>{t.update(()=>{e&&zw(e,Fl)})},[t]),null}const{color:ku,cornerRadius:Nv,spacing:$a}=j;function iL({label:e,plugins:t,field:n,disabled:r=!1,locale:o,toolbar:i,defaultMarkdown:s,events:a={}}){const[l,c]=S.useState(""),[u,f]=S.useState(!1),{availableActions:d,onImagesUpload:h}=i||{},g=S.useMemo(()=>mC(),[]),p=S.useMemo(()=>({isEditable:!r,isPreviewMode:u,setPreviewMode:f,markdownText:l}),[r,u,l]),m=S.useMemo(()=>({availableActions:d||Z6}),[d]),x=S.useCallback(v=>{c(v),a.onMarkdownChange&&a.onMarkdownChange(v)},[a]),y=S.useCallback(v=>{v.read(()=>{const b=FN(Fl);x(b),a.onEditorStateChange&&a.onEditorStateChange(v)})},[x,a]);return C.jsx(i3,{locale:o,children:C.jsx(Ww,{initialConfig:g,children:C.jsx(sh.Provider,{value:p,children:C.jsxs(w1.Provider,{value:m,children:[C.jsxs(G,{flex:!0,w:"full",borderRadius:Nv.lg,p:$a.lg,gap:$a.sm,backgroundColor:ku.fill.neutralSecondary,children:[e?C.jsx(se,{variant:"headline-3",fontWeight:"semibold",children:e}):null,C.jsx(y6,{onImagesUpload:h}),C.jsx(G,{backgroundColor:ku.fill.neutralPrimary,border:`1px solid ${ku.border.neutralAlphaBasic}`,borderRadius:Nv.md,p:`${$a.md} ${$a.lg}`,w:"full",h:144,overflow:"auto",children:u?C.jsx(V6,{}):C.jsx($6,{...n})})]}),C.jsx($N,{}),C.jsx(UN,{}),C.jsx(MP,{}),C.jsx(KN,{}),C.jsx(ZN,{transformers:Fl}),C.jsx(QN,{onChange:y}),C.jsx(J6,{}),C.jsx(oL,{defaultValue:s}),C.jsx(Q6,{}),t]})})})})}const{color:pn}=j,Yo={input:R.css({...me.common,...me.body1,width:48,height:48,textAlign:"center",borderRadius:12,border:`1px solid ${pn.border.neutralAlphaBasic}`,color:pn.text.primary,outline:"none",transition:"border-color 0.5s ease, background-color 0.5s ease, box-shadow 0.5s ease","&::placeholder":{color:pn.text.tertiary},"&:focus-visible":{borderColor:pn.border.accentPrimary,boxShadow:`0 0 0 1px ${pn.border.accentPrimary}`},"&:not(.disabled):hover":{backgroundColor:pn.fill.neutralPrimaryHover},"&:disabled":{opacity:.6,cursor:"not-allowed"}}),error:R.css({borderColor:pn.border.negativePrimary}),success:R.css({borderColor:pn.border.positivePrimary}),disabled:R.css({pointerEvents:"none",opacity:.5}),white:R.css({background:pn.fill.bgPrimary}),gray:R.css({background:pn.fill.bgSecondary}),glow:R.css({position:"absolute",inset:0,borderRadius:12,pointerEvents:"none",opacity:0,transformOrigin:"center",background:pn.fill.accentPrimary})};function sL(e){const t=S.useRef(void 0);return S.useEffect(()=>{t.current=e},[e]),t.current}const{spacing:Pv}=j,yC=S.forwardRef(({length:e=6,label:t,prompt:n,error:r,errorText:o,success:i,disabled:s,autoFocus:a,center:l,secure:c,loading:u,background:f="gray",numeric:d=!0,className:h,value:g,defaultValue:p,onChange:m,onComplete:x},y)=>{const v=typeof g=="string",b=v?g:p,w=typeof b=="string"?b.slice(0,e):"",[_,E]=Fo(v?g:void 0,w),[T,k]=S.useState(()=>{const L=w.slice(0,e);return Array.from({length:e},(N,V)=>L[V]??"")}),P=S.useRef(void 0),O=sL(g),D=S.useRef([]);S.useEffect(()=>{if(!v)return;const L=g??"";if(L===O)return;if(L===P.current){P.current=void 0;return}const N=L.slice(0,e);k(Array.from({length:e},(V,K)=>N[K]??""))},[v,g,e,O]);const I=S.useCallback((L,N)=>{const V=L.slice(0,e);N?.fromInternal&&(P.current=V),E(V),m?.(V),V.length===e&&x?.(V)},[e,m,x,E]);S.useImperativeHandle(y,()=>({focus:()=>{D.current[0]?.focus()},blur:()=>{D.current.forEach(L=>L?.blur())},get value(){return _||""},setValue:L=>{const N=L.slice(0,e);k(Array.from({length:e},(V,K)=>N[K]??"")),I(N,{fromInternal:!0})},clear:()=>{k(Array.from({length:e},()=>"")),I("",{fromInternal:!0})}}),[e,I,_]);const $=S.useCallback((L,N)=>{if(s)return;let V=N;if(d&&(V=V.replace(/\D/g,"")),V.length>1){const Z=T.slice(0,L).join("")+V+T.slice(L+1).join(""),ae=Array.from({length:e},(Te,ne)=>Z[ne]??"");k(ae),I(Z,{fromInternal:!0});const oe=Math.min(L+V.length,e-1),fe=D.current[oe];fe?.focus(),fe?.select();return}const K=T[L],te=[...T];te[L]=V,k(te);const J=te.join("");if(I(J,{fromInternal:!0}),!K&&V&&L<e-1){const Z=D.current[L+1];Z?.focus(),Z?.select()}},[T,s,e,d,I]),H=S.useCallback((L,N)=>{if(!s){if(N.key==="Backspace"){N.preventDefault();const V=D.current[L];if(T[L]){const K=[...T];K[L]="",k(K),I(K.join(""),{fromInternal:!0}),V?.focus();return}if(L>0){const K=D.current[L-1];K?.focus(),K?.select()}return}N.key==="ArrowLeft"&&L>0&&(N.preventDefault(),D.current[L-1]?.focus()),N.key==="ArrowRight"&&L<e-1&&(N.preventDefault(),D.current[L+1]?.focus())}},[T,s,e,I]),U=S.useCallback((L,N)=>{if(s)return;N.preventDefault();let V=N.clipboardData.getData("text");if(d&&(V=V.replace(/\D/g,"")),!V)return;const K=e-L,te=Math.min(V.length,K),J=V.slice(0,te),Z=[...T];for(let Te=0;Te<te;Te++)Z[L+Te]=J[Te]??"";k(Z);const ae=Z.join("");I(ae,{fromInternal:!0});const oe=Math.min(L+te-1,e-1),fe=D.current[oe];fe?.focus(),fe?.select()},[T,s,e,d,I]);return C.jsxs(G,{w:"full",gap:Pv.sm,className:h,center:l,children:[t&&C.jsx(se,{variant:"body-2",fontWeight:"regular",colorName:"tertiary",children:t}),C.jsx(G,{row:!0,w:"full",gap:Pv.sm,center:l,className:R.cx({[Yo.disabled]:s}),children:Array.from({length:e}).map((L,N)=>C.jsxs(G,{relative:!0,display:"inline-block",children:[C.jsx("input",{ref:V=>{D.current[N]=V},className:R.cx(Yo.input,Yo[f],r&&Yo.error,i&&Yo.success,T[N]&&R.css({caretColor:"transparent"})),inputMode:d?"numeric":"text",type:c?"password":"text",maxLength:1,autoFocus:a&&N===0,disabled:s||u,value:T[N],onChange:V=>$(N,V.target.value),onKeyDown:V=>H(N,V),onPaste:V=>U(N,V)}),C.jsx(Us.span,{className:Yo.glow,variants:aL,custom:N,initial:"idle",animate:u?"wave":"idle"})]},N))}),n&&C.jsx(se,{variant:"caption-1",colorName:"tertiary",children:n}),o&&r&&C.jsx(se,{variant:"body-2",colorName:"negative",fontWeight:"regular",children:o})]})}),aL={idle:{opacity:0,scale:1,transition:{duration:.18}},wave:(e=0)=>({opacity:[0,.2,0],scale:[1,1.03,1],transition:{duration:1.5,delay:e*.15,repeat:1/0,ease:[.42,0,.58,1]}})};yC.displayName="OtpInput";const vC=S.createContext(null),lL=()=>S.useContext(vC),{spacing:cL}=j,ss={radio:R.css({display:"flex",alignItems:"flex-start",justifyContent:"flex-start",gap:cL.md,cursor:"pointer"}),disabled:R.css({opacity:.5,cursor:"not-allowed"}),sideRight:R.css({flexDirection:"row-reverse",justifyContent:"space-between"}),readOnly:R.css({cursor:"auto"}),checked:R.css({})},{color:wr,cornerRadius:Lv}=j,Fv={sm:{inner:12,outer:20},md:{inner:16,outer:24}},xC=S.forwardRef(({value:e,children:t,checked:n,defaultChecked:r,onChange:o,disabled:i,className:s,description:a,size:l,side:c,readOnly:u,error:f},d)=>{const h=lL(),g=!!h,p=n!==void 0,[m,x]=Fo(n,r),y=g?h.value===e:p?n:m,v=h?.disabled||i,b=l??h?.size??"md",w=c??h?.side??"left",_=u??h?.readOnly??!1,E=f??h?.error??!1,T=Fv[b].outer,k=Fv[b].inner,P=()=>{v||_||(g?h.setValue?.(e):(p||x(!y),o?.(!y)))},O=y&&E?wr.fill.negativeTint:y?wr.fill.accentTint:wr.fill.bgSecondary,D=y&&E?wr.fill.negativePrimary:y?wr.fill.accentPrimary:void 0,I=y&&E||E&&!y?wr.border.negativeSecondary:wr.border.neutralAlphaLow;return C.jsxs("button",{ref:d,role:"radio",type:"button","data-value":e,"aria-checked":y,"aria-disabled":v||void 0,tabIndex:y?0:-1,className:R.cx([ss.radio,y&&ss.checked,v&&ss.disabled,w==="right"&&ss.sideRight,_&&ss.readOnly,s]),onClick:P,children:[C.jsx(G,{w:T,h:T,backgroundColor:O,borderWidth:y?0:1,borderColor:I,borderStyle:"solid",center:!0,borderRadius:Lv.fullRound,children:C.jsx(G,{w:k,h:k,backgroundColor:D,borderRadius:Lv.fullRound,"aria-hidden":!0})}),C.jsxs(G,{alignItems:"flex-start",children:[C.jsx(se,{variant:b==="sm"?"body-2":"body-1",tag:"span",left:!0,children:t}),a&&C.jsx(se,{tag:"span",variant:"body-2",colorName:"secondary",children:a})]})]})});xC.displayName="Radio";const{spacing:$v}=j,bC=S.forwardRef(({label:e,value:t,defaultValue:n,onChange:r,children:o,className:i,error:s=!1,disabled:a=!1,readOnly:l=!1,side:c="left",size:u="md"},f)=>{const[d,h]=Fo(t,n),g=t!==void 0,p=g?t:d,m=S.useCallback(y=>{g||h(y),r?.(y)},[g,r,h]),x=S.useRef(null);return S.useImperativeHandle(f,()=>x.current),C.jsx(vC.Provider,{value:{value:p,readOnly:l,disabled:a,setValue:m,size:u,side:c,error:s},children:C.jsxs(G,{gap:$v.sm,ref:x,role:"radiogroup","aria-invalid":s||void 0,className:i,children:[typeof e=="string"?C.jsx(se,{colorName:"secondary",children:e}):e,C.jsx(G,{gap:$v.lg,children:o})]})})});bC.displayName="RadioGroup";const{color:tr}=j,Ov=R.css({border:`1px solid ${tr.border.neutralAlphaBasic}`}),Iv=R.css({display:"flex",alignItems:"center",justifyContent:"center"}),Cr={primary:R.css({background:tr.fill.bgPrimary,border:`1px solid ${tr.border.neutralAlphaBasic}`}),secondary:R.css({background:tr.fill.bgSecondary,border:`1px solid ${tr.border.neutralAlphaBasic}`}),button:R.css({cursor:"pointer",border:"1px solid transparent",borderRadius:8,padding:"8px 12px",display:"inline-flex",alignItems:"center",justifyContent:"center",gap:10,transition:"all 0.15s ease",position:"relative",overflow:"hidden",background:"none",[`&:hover:not(.${Ov})`]:{background:tr.fill.neutralPrimaryHover},[`& .${Iv} svg`]:{color:tr.icon.tertiary},"&:disabled":{cursor:"not-allowed",opacity:.5}}),"button-active":Ov,"button-primary":R.css({background:tr.fill.bgSecondary}),"button-secondary":R.css({background:tr.fill.bgPrimary}),"button-disabled":R.css({opacity:.5,cursor:"not-allowed"}),"full-width":R.css({width:"100%"}),"icon-container":Iv},{color:Dv,cornerRadius:uL,spacing:jv}=j;function dL({value:e,onChange:t,options:n,variant:r="primary",fullWidth:o=!1,className:i}){return C.jsx(G,{row:!0,alignItems:"center",borderRadius:uL.md,p:jv.xs,gap:jv.md,className:R.cx(Cr[r],o&&Cr["full-width"],i),children:n.map(s=>{const a=s.value===e,l=s.disabled,c=s.separatorAfter??!1;return C.jsxs(S.Fragment,{children:[C.jsxs("button",{type:"button",disabled:l,className:R.cx(Cr.button,o&&Cr["full-width"],a&&Cr["button-active"],a&&Cr[`button-${r}`],l&&Cr["button-disabled"]),onClick:()=>!l&&t(s.value),children:[s.icon&&C.jsx(G,{alignItems:"center",justifyContent:"center",className:Cr["icon-container"],children:s.icon}),s.label&&C.jsx(se,{colorName:a?"primary":"tertiary",children:s.label}),!l&&C.jsx($o,{color:Dv.fill.bgOverlayPrimary})]}),c&&C.jsx(G,{w:1,h:24,backgroundColor:Dv.fill.bgTertiary})]},s.value)})})}function uc(){return typeof window<"u"}function Wi(e){return wC(e)?(e.nodeName||"").toLowerCase():"#document"}function Bt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Yn(e){var t;return(t=(wC(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function wC(e){return uc()?e instanceof Node||e instanceof Bt(e).Node:!1}function je(e){return uc()?e instanceof Element||e instanceof Bt(e).Element:!1}function Pt(e){return uc()?e instanceof HTMLElement||e instanceof Bt(e).HTMLElement:!1}function uf(e){return!uc()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Bt(e).ShadowRoot}const fL=new Set(["inline","contents"]);function sa(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=cn(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!fL.has(o)}const hL=new Set(["table","td","th"]);function gL(e){return hL.has(Wi(e))}const pL=[":popover-open",":modal"];function dc(e){return pL.some(t=>{try{return e.matches(t)}catch{return!1}})}const mL=["transform","translate","scale","rotate","perspective"],yL=["transform","translate","scale","rotate","perspective","filter"],vL=["paint","layout","strict","content"];function eg(e){const t=fc(),n=je(e)?cn(e):e;return mL.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||yL.some(r=>(n.willChange||"").includes(r))||vL.some(r=>(n.contain||"").includes(r))}function xL(e){let t=vr(e);for(;Pt(t)&&!hr(t);){if(eg(t))return t;if(dc(t))return null;t=vr(t)}return null}function fc(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const bL=new Set(["html","body","#document"]);function hr(e){return bL.has(Wi(e))}function cn(e){return Bt(e).getComputedStyle(e)}function hc(e){return je(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function vr(e){if(Wi(e)==="html")return e;const t=e.assignedSlot||e.parentNode||uf(e)&&e.host||Yn(e);return uf(t)?t.host:t}function CC(e){const t=vr(e);return hr(t)?e.ownerDocument?e.ownerDocument.body:e.body:Pt(t)&&sa(t)?t:CC(t)}function $r(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=CC(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=Bt(o);if(i){const a=df(s);return t.concat(s,s.visualViewport||[],sa(o)?o:[],a&&n?$r(a):[])}return t.concat(o,$r(o,[],n))}function df(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const Wr=Math.min,Ut=Math.max,$l=Math.round,Oa=Math.floor,Gn=e=>({x:e,y:e}),wL={left:"right",right:"left",bottom:"top",top:"bottom"},CL={start:"end",end:"start"};function ff(e,t,n){return Ut(e,Wr(t,n))}function Ki(e,t){return typeof e=="function"?e(t):e}function Kr(e){return e.split("-")[0]}function Ui(e){return e.split("-")[1]}function SC(e){return e==="x"?"y":"x"}function tg(e){return e==="y"?"height":"width"}const SL=new Set(["top","bottom"]);function dr(e){return SL.has(Kr(e))?"y":"x"}function ng(e){return SC(dr(e))}function _L(e,t,n){n===void 0&&(n=!1);const r=Ui(e),o=ng(e),i=tg(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=Ol(s)),[s,Ol(s)]}function TL(e){const t=Ol(e);return[hf(e),t,hf(t)]}function hf(e){return e.replace(/start|end/g,t=>CL[t])}const Vv=["left","right"],Bv=["right","left"],EL=["top","bottom"],RL=["bottom","top"];function kL(e,t,n){switch(e){case"top":case"bottom":return n?t?Bv:Vv:t?Vv:Bv;case"left":case"right":return t?EL:RL;default:return[]}}function AL(e,t,n,r){const o=Ui(e);let i=kL(Kr(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(hf)))),i}function Ol(e){return e.replace(/left|right|bottom|top/g,t=>wL[t])}function ML(e){return{top:0,right:0,bottom:0,left:0,...e}}function _C(e){return typeof e!="number"?ML(e):{top:e,right:e,bottom:e,left:e}}function Il(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function NL(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function PL(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:r}=t;return n+"/"+r}).join(" "):navigator.userAgent}function LL(){return/apple/i.test(navigator.vendor)}function FL(){return NL().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function $L(){return PL().includes("jsdom/")}const zv="data-floating-ui-focusable",OL="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function Hv(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function js(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&uf(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function oi(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Au(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function IL(e){return e.matches("html,body")}function po(e){return e?.ownerDocument||document}function TC(e){return Pt(e)&&e.matches(OL)}function DL(e){if(!e||$L())return!0;try{return e.matches(":focus-visible")}catch{return!0}}function jL(e){return e?e.hasAttribute(zv)?e:e.querySelector("["+zv+"]")||e:null}function tl(e,t,n){return n===void 0&&(n=!0),e.filter(o=>{var i;return o.parentId===t&&(!n||((i=o.context)==null?void 0:i.open))}).flatMap(o=>[o,...tl(e,o.id,n)])}function VL(e){return"nativeEvent"in e}function Vs(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}var BL=typeof document<"u",zL=function(){},Pi=BL?S.useLayoutEffect:zL;const HL={...M};function Ia(e){const t=M.useRef(e);return Pi(()=>{t.current=e}),t}const WL=HL.useInsertionEffect,KL=WL||(e=>e());function In(e){const t=M.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return KL(()=>{t.current=e}),M.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}function Wv(e,t,n){let{reference:r,floating:o}=e;const i=dr(t),s=ng(t),a=tg(s),l=Kr(t),c=i==="y",u=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,d=r[a]/2-o[a]/2;let h;switch(l){case"top":h={x:u,y:r.y-o.height};break;case"bottom":h={x:u,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:f};break;case"left":h={x:r.x-o.width,y:f};break;default:h={x:r.x,y:r.y}}switch(Ui(t)){case"start":h[s]-=d*(n&&c?-1:1);break;case"end":h[s]+=d*(n&&c?-1:1);break}return h}const UL=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:f}=Wv(c,r,l),d=r,h={},g=0;for(let p=0;p<a.length;p++){const{name:m,fn:x}=a[p],{x:y,y:v,data:b,reset:w}=await x({x:u,y:f,initialPlacement:r,placement:d,strategy:o,middlewareData:h,rects:c,platform:s,elements:{reference:e,floating:t}});u=y??u,f=v??f,h={...h,[m]:{...h[m],...b}},w&&g<=50&&(g++,typeof w=="object"&&(w.placement&&(d=w.placement),w.rects&&(c=w.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):w.rects),{x:u,y:f}=Wv(c,d,l)),p=-1)}return{x:u,y:f,placement:d,strategy:o,middlewareData:h}};async function rg(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:d=!1,padding:h=0}=Ki(t,e),g=_C(h),m=a[d?f==="floating"?"reference":"floating":f],x=Il(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(m)))==null||n?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),y=f==="floating"?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,v=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),b=await(i.isElement==null?void 0:i.isElement(v))?await(i.getScale==null?void 0:i.getScale(v))||{x:1,y:1}:{x:1,y:1},w=Il(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:y,offsetParent:v,strategy:l}):y);return{top:(x.top-w.top+g.top)/b.y,bottom:(w.bottom-x.bottom+g.bottom)/b.y,left:(x.left-w.left+g.left)/b.x,right:(w.right-x.right+g.right)/b.x}}const GL=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:l}=t,{element:c,padding:u=0}=Ki(e,t)||{};if(c==null)return{};const f=_C(u),d={x:n,y:r},h=ng(o),g=tg(h),p=await s.getDimensions(c),m=h==="y",x=m?"top":"left",y=m?"bottom":"right",v=m?"clientHeight":"clientWidth",b=i.reference[g]+i.reference[h]-d[h]-i.floating[g],w=d[h]-i.reference[h],_=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let E=_?_[v]:0;(!E||!await(s.isElement==null?void 0:s.isElement(_)))&&(E=a.floating[v]||i.floating[g]);const T=b/2-w/2,k=E/2-p[g]/2-1,P=Wr(f[x],k),O=Wr(f[y],k),D=P,I=E-p[g]-O,$=E/2-p[g]/2+T,H=ff(D,$,I),U=!l.arrow&&Ui(o)!=null&&$!==H&&i.reference[g]/2-($<D?P:O)-p[g]/2<0,L=U?$<D?$-D:$-I:0;return{[h]:d[h]+L,data:{[h]:H,centerOffset:$-H-L,...U&&{alignmentOffset:L}},reset:U}}}),qL=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:d,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:p=!0,...m}=Ki(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const x=Kr(o),y=dr(a),v=Kr(a)===a,b=await(l.isRTL==null?void 0:l.isRTL(c.floating)),w=d||(v||!p?[Ol(a)]:TL(a)),_=g!=="none";!d&&_&&w.push(...AL(a,p,g,b));const E=[a,...w],T=await rg(t,m),k=[];let P=((r=i.flip)==null?void 0:r.overflows)||[];if(u&&k.push(T[x]),f){const $=_L(o,s,b);k.push(T[$[0]],T[$[1]])}if(P=[...P,{placement:o,overflows:k}],!k.every($=>$<=0)){var O,D;const $=(((O=i.flip)==null?void 0:O.index)||0)+1,H=E[$];if(H&&(!(f==="alignment"?y!==dr(H):!1)||P.every(N=>dr(N.placement)===y?N.overflows[0]>0:!0)))return{data:{index:$,overflows:P},reset:{placement:H}};let U=(D=P.filter(L=>L.overflows[0]<=0).sort((L,N)=>L.overflows[1]-N.overflows[1])[0])==null?void 0:D.placement;if(!U)switch(h){case"bestFit":{var I;const L=(I=P.filter(N=>{if(_){const V=dr(N.placement);return V===y||V==="y"}return!0}).map(N=>[N.placement,N.overflows.filter(V=>V>0).reduce((V,K)=>V+K,0)]).sort((N,V)=>N[1]-V[1])[0])==null?void 0:I[0];L&&(U=L);break}case"initialPlacement":U=a;break}if(o!==U)return{reset:{placement:U}}}return{}}}},YL=new Set(["left","top"]);async function XL(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=Kr(n),a=Ui(n),l=dr(n)==="y",c=YL.has(s)?-1:1,u=i&&l?-1:1,f=Ki(t,e);let{mainAxis:d,crossAxis:h,alignmentAxis:g}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return a&&typeof g=="number"&&(h=a==="end"?g*-1:g),l?{x:h*u,y:d*c}:{x:d*c,y:h*u}}const ZL=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:s,middlewareData:a}=t,l=await XL(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:s}}}}},JL=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:a={fn:m=>{let{x,y}=m;return{x,y}}},...l}=Ki(e,t),c={x:n,y:r},u=await rg(t,l),f=dr(Kr(o)),d=SC(f);let h=c[d],g=c[f];if(i){const m=d==="y"?"top":"left",x=d==="y"?"bottom":"right",y=h+u[m],v=h-u[x];h=ff(y,h,v)}if(s){const m=f==="y"?"top":"left",x=f==="y"?"bottom":"right",y=g+u[m],v=g-u[x];g=ff(y,g,v)}const p=a.fn({...t,[d]:h,[f]:g});return{...p,data:{x:p.x-n,y:p.y-r,enabled:{[d]:i,[f]:s}}}}}},QL=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:s,elements:a}=t,{apply:l=()=>{},...c}=Ki(e,t),u=await rg(t,c),f=Kr(o),d=Ui(o),h=dr(o)==="y",{width:g,height:p}=i.floating;let m,x;f==="top"||f==="bottom"?(m=f,x=d===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(x=f,m=d==="end"?"top":"bottom");const y=p-u.top-u.bottom,v=g-u.left-u.right,b=Wr(p-u[m],y),w=Wr(g-u[x],v),_=!t.middlewareData.shift;let E=b,T=w;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(T=v),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(E=y),_&&!d){const P=Ut(u.left,0),O=Ut(u.right,0),D=Ut(u.top,0),I=Ut(u.bottom,0);h?T=g-2*(P!==0||O!==0?P+O:Ut(u.left,u.right)):E=p-2*(D!==0||I!==0?D+I:Ut(u.top,u.bottom))}await l({...t,availableWidth:T,availableHeight:E});const k=await s.getDimensions(a.floating);return g!==k.width||p!==k.height?{reset:{rects:!0}}:{}}}};function EC(e){const t=cn(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Pt(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=$l(n)!==i||$l(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function og(e){return je(e)?e:e.contextElement}function Ci(e){const t=og(e);if(!Pt(t))return Gn(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=EC(t);let s=(i?$l(n.width):n.width)/r,a=(i?$l(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const eF=Gn(0);function RC(e){const t=Bt(e);return!fc()||!t.visualViewport?eF:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function tF(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Bt(e)?!1:t}function Lo(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=og(e);let s=Gn(1);t&&(r?je(r)&&(s=Ci(r)):s=Ci(e));const a=tF(i,n,r)?RC(i):Gn(0);let l=(o.left+a.x)/s.x,c=(o.top+a.y)/s.y,u=o.width/s.x,f=o.height/s.y;if(i){const d=Bt(i),h=r&&je(r)?Bt(r):r;let g=d,p=df(g);for(;p&&r&&h!==g;){const m=Ci(p),x=p.getBoundingClientRect(),y=cn(p),v=x.left+(p.clientLeft+parseFloat(y.paddingLeft))*m.x,b=x.top+(p.clientTop+parseFloat(y.paddingTop))*m.y;l*=m.x,c*=m.y,u*=m.x,f*=m.y,l+=v,c+=b,g=Bt(p),p=df(g)}}return Il({width:u,height:f,x:l,y:c})}function gc(e,t){const n=hc(e).scrollLeft;return t?t.left+n:Lo(Yn(e)).left+n}function kC(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-gc(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function nF(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",s=Yn(r),a=t?dc(t.floating):!1;if(r===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},c=Gn(1);const u=Gn(0),f=Pt(r);if((f||!f&&!i)&&((Wi(r)!=="body"||sa(s))&&(l=hc(r)),Pt(r))){const h=Lo(r);c=Ci(r),u.x=h.x+r.clientLeft,u.y=h.y+r.clientTop}const d=s&&!f&&!i?kC(s,l):Gn(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+d.x,y:n.y*c.y-l.scrollTop*c.y+u.y+d.y}}function rF(e){return Array.from(e.getClientRects())}function oF(e){const t=Yn(e),n=hc(e),r=e.ownerDocument.body,o=Ut(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Ut(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+gc(e);const a=-n.scrollTop;return cn(r).direction==="rtl"&&(s+=Ut(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}const Kv=25;function iF(e,t){const n=Bt(e),r=Yn(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const u=fc();(!u||u&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}const c=gc(r);if(c<=0){const u=r.ownerDocument,f=u.body,d=getComputedStyle(f),h=u.compatMode==="CSS1Compat"&&parseFloat(d.marginLeft)+parseFloat(d.marginRight)||0,g=Math.abs(r.clientWidth-f.clientWidth-h);g<=Kv&&(i-=g)}else c<=Kv&&(i+=c);return{width:i,height:s,x:a,y:l}}const sF=new Set(["absolute","fixed"]);function aF(e,t){const n=Lo(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=Pt(e)?Ci(e):Gn(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,l=o*i.x,c=r*i.y;return{width:s,height:a,x:l,y:c}}function Uv(e,t,n){let r;if(t==="viewport")r=iF(e,n);else if(t==="document")r=oF(Yn(e));else if(je(t))r=aF(t,n);else{const o=RC(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Il(r)}function AC(e,t){const n=vr(e);return n===t||!je(n)||hr(n)?!1:cn(n).position==="fixed"||AC(n,t)}function lF(e,t){const n=t.get(e);if(n)return n;let r=$r(e,[],!1).filter(a=>je(a)&&Wi(a)!=="body"),o=null;const i=cn(e).position==="fixed";let s=i?vr(e):e;for(;je(s)&&!hr(s);){const a=cn(s),l=eg(s);!l&&a.position==="fixed"&&(o=null),(i?!l&&!o:!l&&a.position==="static"&&!!o&&sF.has(o.position)||sa(s)&&!l&&AC(e,s))?r=r.filter(u=>u!==s):o=a,s=vr(s)}return t.set(e,r),r}function cF(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?dc(t)?[]:lF(t,this._c):[].concat(n),r],a=s[0],l=s.reduce((c,u)=>{const f=Uv(t,u,o);return c.top=Ut(f.top,c.top),c.right=Wr(f.right,c.right),c.bottom=Wr(f.bottom,c.bottom),c.left=Ut(f.left,c.left),c},Uv(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function uF(e){const{width:t,height:n}=EC(e);return{width:t,height:n}}function dF(e,t,n){const r=Pt(t),o=Yn(t),i=n==="fixed",s=Lo(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=Gn(0);function c(){l.x=gc(o)}if(r||!r&&!i)if((Wi(t)!=="body"||sa(o))&&(a=hc(t)),r){const h=Lo(t,!0,i,t);l.x=h.x+t.clientLeft,l.y=h.y+t.clientTop}else o&&c();i&&!r&&o&&c();const u=o&&!r&&!i?kC(o,a):Gn(0),f=s.left+a.scrollLeft-l.x-u.x,d=s.top+a.scrollTop-l.y-u.y;return{x:f,y:d,width:s.width,height:s.height}}function Mu(e){return cn(e).position==="static"}function Gv(e,t){if(!Pt(e)||cn(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Yn(e)===n&&(n=n.ownerDocument.body),n}function MC(e,t){const n=Bt(e);if(dc(e))return n;if(!Pt(e)){let o=vr(e);for(;o&&!hr(o);){if(je(o)&&!Mu(o))return o;o=vr(o)}return n}let r=Gv(e,t);for(;r&&gL(r)&&Mu(r);)r=Gv(r,t);return r&&hr(r)&&Mu(r)&&!eg(r)?n:r||xL(e)||n}const fF=async function(e){const t=this.getOffsetParent||MC,n=this.getDimensions,r=await n(e.floating);return{reference:dF(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function hF(e){return cn(e).direction==="rtl"}const gF={convertOffsetParentRelativeRectToViewportRelativeRect:nF,getDocumentElement:Yn,getClippingRect:cF,getOffsetParent:MC,getElementRects:fF,getClientRects:rF,getDimensions:uF,getScale:Ci,isElement:je,isRTL:hF};function NC(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function pF(e,t){let n=null,r;const o=Yn(e);function i(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),i();const c=e.getBoundingClientRect(),{left:u,top:f,width:d,height:h}=c;if(a||t(),!d||!h)return;const g=Oa(f),p=Oa(o.clientWidth-(u+d)),m=Oa(o.clientHeight-(f+h)),x=Oa(u),v={rootMargin:-g+"px "+-p+"px "+-m+"px "+-x+"px",threshold:Ut(0,Wr(1,l))||1};let b=!0;function w(_){const E=_[0].intersectionRatio;if(E!==l){if(!b)return s();E?s(!1,E):r=setTimeout(()=>{s(!1,1e-7)},1e3)}E===1&&!NC(c,e.getBoundingClientRect())&&s(),b=!1}try{n=new IntersectionObserver(w,{...v,root:o.ownerDocument})}catch{n=new IntersectionObserver(w,v)}n.observe(e)}return s(!0),i}function ig(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=og(e),u=o||i?[...c?$r(c):[],...$r(t)]:[];u.forEach(x=>{o&&x.addEventListener("scroll",n,{passive:!0}),i&&x.addEventListener("resize",n)});const f=c&&a?pF(c,n):null;let d=-1,h=null;s&&(h=new ResizeObserver(x=>{let[y]=x;y&&y.target===c&&h&&(h.unobserve(t),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var v;(v=h)==null||v.observe(t)})),n()}),c&&!l&&h.observe(c),h.observe(t));let g,p=l?Lo(e):null;l&&m();function m(){const x=Lo(e);p&&!NC(p,x)&&n(),p=x,g=requestAnimationFrame(m)}return n(),()=>{var x;u.forEach(y=>{o&&y.removeEventListener("scroll",n),i&&y.removeEventListener("resize",n)}),f?.(),(x=h)==null||x.disconnect(),h=null,l&&cancelAnimationFrame(g)}}const mF=ZL,yF=JL,vF=qL,xF=QL,qv=GL,bF=(e,t,n)=>{const r=new Map,o={platform:gF,...n},i={...o.platform,_c:r};return UL(e,t,{...o,platform:i})};var wF=typeof document<"u",CF=function(){},nl=wF?S.useLayoutEffect:CF;function Dl(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Dl(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const i=o[r];if(!(i==="_owner"&&e.$$typeof)&&!Dl(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function PC(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Yv(e,t){const n=PC(e);return Math.round(t*n)/n}function Nu(e){const t=M.useRef(e);return nl(()=>{t.current=e}),t}function SF(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:s}={},transform:a=!0,whileElementsMounted:l,open:c}=e,[u,f]=M.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[d,h]=M.useState(r);Dl(d,r)||h(r);const[g,p]=M.useState(null),[m,x]=M.useState(null),y=M.useCallback(N=>{N!==_.current&&(_.current=N,p(N))},[]),v=M.useCallback(N=>{N!==E.current&&(E.current=N,x(N))},[]),b=i||g,w=s||m,_=M.useRef(null),E=M.useRef(null),T=M.useRef(u),k=l!=null,P=Nu(l),O=Nu(o),D=Nu(c),I=M.useCallback(()=>{if(!_.current||!E.current)return;const N={placement:t,strategy:n,middleware:d};O.current&&(N.platform=O.current),bF(_.current,E.current,N).then(V=>{const K={...V,isPositioned:D.current!==!1};$.current&&!Dl(T.current,K)&&(T.current=K,T_.flushSync(()=>{f(K)}))})},[d,t,n,O,D]);nl(()=>{c===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,f(N=>({...N,isPositioned:!1})))},[c]);const $=M.useRef(!1);nl(()=>($.current=!0,()=>{$.current=!1}),[]),nl(()=>{if(b&&(_.current=b),w&&(E.current=w),b&&w){if(P.current)return P.current(b,w,I);I()}},[b,w,I,P,k]);const H=M.useMemo(()=>({reference:_,floating:E,setReference:y,setFloating:v}),[y,v]),U=M.useMemo(()=>({reference:b,floating:w}),[b,w]),L=M.useMemo(()=>{const N={position:n,left:0,top:0};if(!U.floating)return N;const V=Yv(U.floating,u.x),K=Yv(U.floating,u.y);return a?{...N,transform:"translate("+V+"px, "+K+"px)",...PC(U.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:V,top:K}},[n,a,U.floating,u.x,u.y]);return M.useMemo(()=>({...u,update:I,refs:H,elements:U,floatingStyles:L}),[u,I,H,U,L])}const _F=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?qv({element:r.current,padding:o}).fn(n):{}:r?qv({element:r,padding:o}).fn(n):{}}}},sg=(e,t)=>({...mF(e),options:[e,t]}),ag=(e,t)=>({...yF(e),options:[e,t]}),lg=(e,t)=>({...vF(e),options:[e,t]}),TF=(e,t)=>({...xF(e),options:[e,t]}),EF=(e,t)=>({..._F(e),options:[e,t]});function LC(e){const t=M.useRef(void 0),n=M.useCallback(r=>{const o=e.map(i=>{if(i!=null){if(typeof i=="function"){const s=i,a=s(r);return typeof a=="function"?a:()=>{s(null)}}return i.current=r,()=>{i.current=null}}});return()=>{o.forEach(i=>i?.())}},e);return M.useMemo(()=>e.every(r=>r==null)?null:r=>{t.current&&(t.current(),t.current=void 0),r!=null&&(t.current=n(r))},e)}const RF="data-floating-ui-focusable",Xv="active",Zv="selected",kF={...M};let Jv=!1,AF=0;const Qv=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+AF++;function MF(){const[e,t]=M.useState(()=>Jv?Qv():void 0);return Pi(()=>{e==null&&t(Qv())},[]),M.useEffect(()=>{Jv=!0},[]),e}const NF=kF.useId,FC=NF||MF;let gf;process.env.NODE_ENV!=="production"&&(gf=new Set);function PF(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");if(!((e=gf)!=null&&e.has(o))){var i;(i=gf)==null||i.add(o),console.error(o)}}function LF(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(o=>o(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;(r=e.get(t))==null||r.delete(n)}}}const FF=M.createContext(null),$F=M.createContext(null),cg=()=>{var e;return((e=M.useContext(FF))==null?void 0:e.id)||null},ug=()=>M.useContext($F);function dg(e){return"data-floating-ui-"+e}function nn(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}const e0=dg("safe-polygon");function Pu(e,t,n){if(n&&!Vs(n))return 0;if(typeof e=="number")return e;if(typeof e=="function"){const r=e();return typeof r=="number"?r:r?.[t]}return e?.[t]}function Lu(e){return typeof e=="function"?e():e}function $C(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:o,events:i,elements:s}=e,{enabled:a=!0,delay:l=0,handleClose:c=null,mouseOnly:u=!1,restMs:f=0,move:d=!0}=t,h=ug(),g=cg(),p=Ia(c),m=Ia(l),x=Ia(n),y=Ia(f),v=M.useRef(),b=M.useRef(-1),w=M.useRef(),_=M.useRef(-1),E=M.useRef(!0),T=M.useRef(!1),k=M.useRef(()=>{}),P=M.useRef(!1),O=In(()=>{var L;const N=(L=o.current.openEvent)==null?void 0:L.type;return N?.includes("mouse")&&N!=="mousedown"});M.useEffect(()=>{if(!a)return;function L(N){let{open:V}=N;V||(nn(b),nn(_),E.current=!0,P.current=!1)}return i.on("openchange",L),()=>{i.off("openchange",L)}},[a,i]),M.useEffect(()=>{if(!a||!p.current||!n)return;function L(V){O()&&r(!1,V,"hover")}const N=po(s.floating).documentElement;return N.addEventListener("mouseleave",L),()=>{N.removeEventListener("mouseleave",L)}},[s.floating,n,r,a,p,O]);const D=M.useCallback(function(L,N,V){N===void 0&&(N=!0),V===void 0&&(V="hover");const K=Pu(m.current,"close",v.current);K&&!w.current?(nn(b),b.current=window.setTimeout(()=>r(!1,L,V),K)):N&&(nn(b),r(!1,L,V))},[m,r]),I=In(()=>{k.current(),w.current=void 0}),$=In(()=>{if(T.current){const L=po(s.floating).body;L.style.pointerEvents="",L.removeAttribute(e0),T.current=!1}}),H=In(()=>o.current.openEvent?["click","mousedown"].includes(o.current.openEvent.type):!1);M.useEffect(()=>{if(!a)return;function L(J){if(nn(b),E.current=!1,u&&!Vs(v.current)||Lu(y.current)>0&&!Pu(m.current,"open"))return;const Z=Pu(m.current,"open",v.current);Z?b.current=window.setTimeout(()=>{x.current||r(!0,J,"hover")},Z):n||r(!0,J,"hover")}function N(J){if(H()){$();return}k.current();const Z=po(s.floating);if(nn(_),P.current=!1,p.current&&o.current.floatingContext){n||nn(b),w.current=p.current({...o.current.floatingContext,tree:h,x:J.clientX,y:J.clientY,onClose(){$(),I(),H()||D(J,!0,"safe-polygon")}});const oe=w.current;Z.addEventListener("mousemove",oe),k.current=()=>{Z.removeEventListener("mousemove",oe)};return}(v.current!=="touch"||!js(s.floating,J.relatedTarget))&&D(J)}function V(J){H()||o.current.floatingContext&&(p.current==null||p.current({...o.current.floatingContext,tree:h,x:J.clientX,y:J.clientY,onClose(){$(),I(),H()||D(J)}})(J))}function K(){nn(b)}function te(J){H()||D(J,!1)}if(je(s.domReference)){const J=s.domReference,Z=s.floating;return n&&J.addEventListener("mouseleave",V),d&&J.addEventListener("mousemove",L,{once:!0}),J.addEventListener("mouseenter",L),J.addEventListener("mouseleave",N),Z&&(Z.addEventListener("mouseleave",V),Z.addEventListener("mouseenter",K),Z.addEventListener("mouseleave",te)),()=>{n&&J.removeEventListener("mouseleave",V),d&&J.removeEventListener("mousemove",L),J.removeEventListener("mouseenter",L),J.removeEventListener("mouseleave",N),Z&&(Z.removeEventListener("mouseleave",V),Z.removeEventListener("mouseenter",K),Z.removeEventListener("mouseleave",te))}}},[s,a,e,u,d,D,I,$,r,n,x,h,m,p,o,H,y]),Pi(()=>{var L;if(a&&n&&(L=p.current)!=null&&(L=L.__options)!=null&&L.blockPointerEvents&&O()){T.current=!0;const V=s.floating;if(je(s.domReference)&&V){var N;const K=po(s.floating).body;K.setAttribute(e0,"");const te=s.domReference,J=h==null||(N=h.nodesRef.current.find(Z=>Z.id===g))==null||(N=N.context)==null?void 0:N.elements.floating;return J&&(J.style.pointerEvents=""),K.style.pointerEvents="none",te.style.pointerEvents="auto",V.style.pointerEvents="auto",()=>{K.style.pointerEvents="",te.style.pointerEvents="",V.style.pointerEvents=""}}}},[a,n,g,s,h,p,O]),Pi(()=>{n||(v.current=void 0,P.current=!1,I(),$())},[n,I,$]),M.useEffect(()=>()=>{I(),nn(b),nn(_),$()},[a,s.domReference,I,$]);const U=M.useMemo(()=>{function L(N){v.current=N.pointerType}return{onPointerDown:L,onPointerEnter:L,onMouseMove(N){const{nativeEvent:V}=N;function K(){!E.current&&!x.current&&r(!0,V,"hover")}u&&!Vs(v.current)||n||Lu(y.current)===0||P.current&&N.movementX**2+N.movementY**2<2||(nn(_),v.current==="touch"?K():(P.current=!0,_.current=window.setTimeout(K,Lu(y.current))))}}},[u,r,n,x,y]);return M.useMemo(()=>a?{reference:U}:{},[a,U])}function t0(e){return Pt(e.target)&&e.target.tagName==="BUTTON"}function OF(e){return Pt(e.target)&&e.target.tagName==="A"}function n0(e){return TC(e)}function IF(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:o,elements:{domReference:i}}=e,{enabled:s=!0,event:a="click",toggle:l=!0,ignoreMouse:c=!1,keyboardHandlers:u=!0,stickIfOpen:f=!0}=t,d=M.useRef(),h=M.useRef(!1),g=M.useMemo(()=>({onPointerDown(p){d.current=p.pointerType},onMouseDown(p){const m=d.current;p.button===0&&a!=="click"&&(Vs(m,!0)&&c||(n&&l&&(!(o.current.openEvent&&f)||o.current.openEvent.type==="mousedown")?r(!1,p.nativeEvent,"click"):(p.preventDefault(),r(!0,p.nativeEvent,"click"))))},onClick(p){const m=d.current;if(a==="mousedown"&&d.current){d.current=void 0;return}Vs(m,!0)&&c||(n&&l&&(!(o.current.openEvent&&f)||o.current.openEvent.type==="click")?r(!1,p.nativeEvent,"click"):r(!0,p.nativeEvent,"click"))},onKeyDown(p){d.current=void 0,!(p.defaultPrevented||!u||t0(p))&&(p.key===" "&&!n0(i)&&(p.preventDefault(),h.current=!0),!OF(p)&&p.key==="Enter"&&r(!(n&&l),p.nativeEvent,"click"))},onKeyUp(p){p.defaultPrevented||!u||t0(p)||n0(i)||p.key===" "&&h.current&&(h.current=!1,r(!(n&&l),p.nativeEvent,"click"))}}),[o,i,a,c,u,r,n,f,l]);return M.useMemo(()=>s?{reference:g}:{},[s,g])}const DF={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},jF={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},r0=e=>{var t,n;return{escapeKey:typeof e=="boolean"?e:(t=e?.escapeKey)!=null?t:!1,outsidePress:typeof e=="boolean"?e:(n=e?.outsidePress)!=null?n:!0}};function OC(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,elements:o,dataRef:i}=e,{enabled:s=!0,escapeKey:a=!0,outsidePress:l=!0,outsidePressEvent:c="pointerdown",referencePress:u=!1,referencePressEvent:f="pointerdown",ancestorScroll:d=!1,bubbles:h,capture:g}=t,p=ug(),m=In(typeof l=="function"?l:()=>!1),x=typeof l=="function"?m:l,y=M.useRef(!1),{escapeKey:v,outsidePress:b}=r0(h),{escapeKey:w,outsidePress:_}=r0(g),E=M.useRef(!1),T=In($=>{var H;if(!n||!s||!a||$.key!=="Escape"||E.current)return;const U=(H=i.current.floatingContext)==null?void 0:H.nodeId,L=p?tl(p.nodesRef.current,U):[];if(!v&&($.stopPropagation(),L.length>0)){let N=!0;if(L.forEach(V=>{var K;if((K=V.context)!=null&&K.open&&!V.context.dataRef.current.__escapeKeyBubbles){N=!1;return}}),!N)return}r(!1,VL($)?$.nativeEvent:$,"escape-key")}),k=In($=>{var H;const U=()=>{var L;T($),(L=oi($))==null||L.removeEventListener("keydown",U)};(H=oi($))==null||H.addEventListener("keydown",U)}),P=In($=>{var H;const U=i.current.insideReactTree;i.current.insideReactTree=!1;const L=y.current;if(y.current=!1,c==="click"&&L||U||typeof x=="function"&&!x($))return;const N=oi($),V="["+dg("inert")+"]",K=po(o.floating).querySelectorAll(V);let te=je(N)?N:null;for(;te&&!hr(te);){const oe=vr(te);if(hr(oe)||!je(oe))break;te=oe}if(K.length&&je(N)&&!IL(N)&&!js(N,o.floating)&&Array.from(K).every(oe=>!js(te,oe)))return;if(Pt(N)&&I){const oe=hr(N),fe=cn(N),Te=/auto|scroll/,ne=oe||Te.test(fe.overflowX),ve=oe||Te.test(fe.overflowY),Ee=ne&&N.clientWidth>0&&N.scrollWidth>N.clientWidth,De=ve&&N.clientHeight>0&&N.scrollHeight>N.clientHeight,st=fe.direction==="rtl",ee=De&&(st?$.offsetX<=N.offsetWidth-N.clientWidth:$.offsetX>N.clientWidth),Ce=Ee&&$.offsetY>N.clientHeight;if(ee||Ce)return}const J=(H=i.current.floatingContext)==null?void 0:H.nodeId,Z=p&&tl(p.nodesRef.current,J).some(oe=>{var fe;return Au($,(fe=oe.context)==null?void 0:fe.elements.floating)});if(Au($,o.floating)||Au($,o.domReference)||Z)return;const ae=p?tl(p.nodesRef.current,J):[];if(ae.length>0){let oe=!0;if(ae.forEach(fe=>{var Te;if((Te=fe.context)!=null&&Te.open&&!fe.context.dataRef.current.__outsidePressBubbles){oe=!1;return}}),!oe)return}r(!1,$,"outside-press")}),O=In($=>{var H;const U=()=>{var L;P($),(L=oi($))==null||L.removeEventListener(c,U)};(H=oi($))==null||H.addEventListener(c,U)});M.useEffect(()=>{if(!n||!s)return;i.current.__escapeKeyBubbles=v,i.current.__outsidePressBubbles=b;let $=-1;function H(K){r(!1,K,"ancestor-scroll")}function U(){window.clearTimeout($),E.current=!0}function L(){$=window.setTimeout(()=>{E.current=!1},fc()?5:0)}const N=po(o.floating);a&&(N.addEventListener("keydown",w?k:T,w),N.addEventListener("compositionstart",U),N.addEventListener("compositionend",L)),x&&N.addEventListener(c,_?O:P,_);let V=[];return d&&(je(o.domReference)&&(V=$r(o.domReference)),je(o.floating)&&(V=V.concat($r(o.floating))),!je(o.reference)&&o.reference&&o.reference.contextElement&&(V=V.concat($r(o.reference.contextElement)))),V=V.filter(K=>{var te;return K!==((te=N.defaultView)==null?void 0:te.visualViewport)}),V.forEach(K=>{K.addEventListener("scroll",H,{passive:!0})}),()=>{a&&(N.removeEventListener("keydown",w?k:T,w),N.removeEventListener("compositionstart",U),N.removeEventListener("compositionend",L)),x&&N.removeEventListener(c,_?O:P,_),V.forEach(K=>{K.removeEventListener("scroll",H)}),window.clearTimeout($)}},[i,o,a,x,c,n,r,d,s,v,b,T,w,k,P,_,O]),M.useEffect(()=>{i.current.insideReactTree=!1},[i,x,c]);const D=M.useMemo(()=>({onKeyDown:T,...u&&{[DF[f]]:$=>{r(!1,$.nativeEvent,"reference-press")},...f!=="click"&&{onClick($){r(!1,$.nativeEvent,"reference-press")}}}}),[T,r,u,f]),I=M.useMemo(()=>({onKeyDown:T,onMouseDown(){y.current=!0},onMouseUp(){y.current=!0},[jF[c]]:()=>{i.current.insideReactTree=!0}}),[T,c,i]);return M.useMemo(()=>s?{reference:D,floating:I}:{},[s,D,I])}function VF(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=FC(),i=M.useRef({}),[s]=M.useState(()=>LF()),a=cg()!=null;if(process.env.NODE_ENV!=="production"){const h=r.reference;h&&!je(h)&&PF("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[l,c]=M.useState(r.reference),u=In((h,g,p)=>{i.current.openEvent=h?g:void 0,s.emit("openchange",{open:h,event:g,reason:p,nested:a}),n?.(h,g,p)}),f=M.useMemo(()=>({setPositionReference:c}),[]),d=M.useMemo(()=>({reference:l||r.reference||null,floating:r.floating||null,domReference:r.reference}),[l,r.reference,r.floating]);return M.useMemo(()=>({dataRef:i,open:t,onOpenChange:u,elements:d,events:s,floatingId:o,refs:f}),[t,u,d,s,o,f])}function fg(e){e===void 0&&(e={});const{nodeId:t}=e,n=VF({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[i,s]=M.useState(null),[a,l]=M.useState(null),u=o?.domReference||i,f=M.useRef(null),d=ug();Pi(()=>{u&&(f.current=u)},[u]);const h=SF({...e,elements:{...o,...a&&{reference:a}}}),g=M.useCallback(v=>{const b=je(v)?{getBoundingClientRect:()=>v.getBoundingClientRect(),getClientRects:()=>v.getClientRects(),contextElement:v}:v;l(b),h.refs.setReference(b)},[h.refs]),p=M.useCallback(v=>{(je(v)||v===null)&&(f.current=v,s(v)),(je(h.refs.reference.current)||h.refs.reference.current===null||v!==null&&!je(v))&&h.refs.setReference(v)},[h.refs]),m=M.useMemo(()=>({...h.refs,setReference:p,setPositionReference:g,domReference:f}),[h.refs,p,g]),x=M.useMemo(()=>({...h.elements,domReference:u}),[h.elements,u]),y=M.useMemo(()=>({...h,...r,refs:m,elements:x,nodeId:t}),[h,m,x,t,r]);return Pi(()=>{r.dataRef.current.floatingContext=y;const v=d?.nodesRef.current.find(b=>b.id===t);v&&(v.context=y)}),M.useMemo(()=>({...h,context:y,refs:m,elements:x}),[h,m,x,y])}function Fu(){return FL()&&LL()}function BF(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,events:o,dataRef:i,elements:s}=e,{enabled:a=!0,visibleOnly:l=!0}=t,c=M.useRef(!1),u=M.useRef(-1),f=M.useRef(!0);M.useEffect(()=>{if(!a)return;const h=Bt(s.domReference);function g(){!n&&Pt(s.domReference)&&s.domReference===Hv(po(s.domReference))&&(c.current=!0)}function p(){f.current=!0}function m(){f.current=!1}return h.addEventListener("blur",g),Fu()&&(h.addEventListener("keydown",p,!0),h.addEventListener("pointerdown",m,!0)),()=>{h.removeEventListener("blur",g),Fu()&&(h.removeEventListener("keydown",p,!0),h.removeEventListener("pointerdown",m,!0))}},[s.domReference,n,a]),M.useEffect(()=>{if(!a)return;function h(g){let{reason:p}=g;(p==="reference-press"||p==="escape-key")&&(c.current=!0)}return o.on("openchange",h),()=>{o.off("openchange",h)}},[o,a]),M.useEffect(()=>()=>{nn(u)},[]);const d=M.useMemo(()=>({onMouseLeave(){c.current=!1},onFocus(h){if(c.current)return;const g=oi(h.nativeEvent);if(l&&je(g)){if(Fu()&&!h.relatedTarget){if(!f.current&&!TC(g))return}else if(!DL(g))return}r(!0,h.nativeEvent,"focus")},onBlur(h){c.current=!1;const g=h.relatedTarget,p=h.nativeEvent,m=je(g)&&g.hasAttribute(dg("focus-guard"))&&g.getAttribute("data-type")==="outside";u.current=window.setTimeout(()=>{var x;const y=Hv(s.domReference?s.domReference.ownerDocument:document);!g&&y===s.domReference||js((x=i.current.floatingContext)==null?void 0:x.refs.floating.current,y)||js(s.domReference,y)||m||r(!1,p,"focus")})}}),[i,s.domReference,r,l]);return M.useMemo(()=>a?{reference:d}:{},[a,d])}function $u(e,t,n){const r=new Map,o=n==="item";let i=e;if(o&&e){const{[Xv]:s,[Zv]:a,...l}=e;i=l}return{...n==="floating"&&{tabIndex:-1,[RF]:""},...i,...t.map(s=>{const a=s?s[n]:null;return typeof a=="function"?e?a(e):null:a}).concat(e).reduce((s,a)=>(a&&Object.entries(a).forEach(l=>{let[c,u]=l;if(!(o&&[Xv,Zv].includes(c)))if(c.indexOf("on")===0){if(r.has(c)||r.set(c,[]),typeof u=="function"){var f;(f=r.get(c))==null||f.push(u),s[c]=function(){for(var d,h=arguments.length,g=new Array(h),p=0;p<h;p++)g[p]=arguments[p];return(d=r.get(c))==null?void 0:d.map(m=>m(...g)).find(m=>m!==void 0)}}}else s[c]=u}),s),{})}}function IC(e){e===void 0&&(e=[]);const t=e.map(a=>a?.reference),n=e.map(a=>a?.floating),r=e.map(a=>a?.item),o=M.useCallback(a=>$u(a,e,"reference"),t),i=M.useCallback(a=>$u(a,e,"floating"),n),s=M.useCallback(a=>$u(a,e,"item"),r);return M.useMemo(()=>({getReferenceProps:o,getFloatingProps:i,getItemProps:s}),[o,i,s])}const zF=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function DC(e,t){var n,r;t===void 0&&(t={});const{open:o,elements:i,floatingId:s}=e,{enabled:a=!0,role:l="dialog"}=t,c=FC(),u=((n=i.domReference)==null?void 0:n.id)||c,f=M.useMemo(()=>{var y;return((y=jL(i.floating))==null?void 0:y.id)||s},[i.floating,s]),d=(r=zF.get(l))!=null?r:l,g=cg()!=null,p=M.useMemo(()=>d==="tooltip"||l==="label"?{["aria-"+(l==="label"?"labelledby":"describedby")]:o?f:void 0}:{"aria-expanded":o?"true":"false","aria-haspopup":d==="alertdialog"?"dialog":d,"aria-controls":o?f:void 0,...d==="listbox"&&{role:"combobox"},...d==="menu"&&{id:u},...d==="menu"&&g&&{role:"menuitem"},...l==="select"&&{"aria-autocomplete":"none"},...l==="combobox"&&{"aria-autocomplete":"list"}},[d,f,g,o,u,l]),m=M.useMemo(()=>{const y={id:f,...d&&{role:d}};return d==="tooltip"||l==="label"?y:{...y,...d==="menu"&&{"aria-labelledby":u}}},[d,f,u,l]),x=M.useCallback(y=>{let{active:v,selected:b}=y;const w={role:"option",...v&&{id:f+"-fui-option"}};switch(l){case"select":case"combobox":return{...w,"aria-selected":b}}return{}},[f,l]);return M.useMemo(()=>a?{reference:p,floating:m,item:x}:{},[a,p,m,x])}const HF=e=>M.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("path",{d:"M6 9L12 15L18 9",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),WF=e=>M.createElement("svg",{fill:"currentColor",id:"Capa_1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0 0 462.035 462.035",xmlSpace:"preserve",...e},M.createElement("g",null,M.createElement("path",{d:"M457.83,158.441c-0.021-0.028-0.033-0.058-0.057-0.087l-50.184-62.48c-0.564-0.701-1.201-1.305-1.879-1.845 c-2.16-2.562-5.355-4.225-8.967-4.225H65.292c-3.615,0-6.804,1.661-8.965,4.225c-0.678,0.54-1.316,1.138-1.885,1.845l-50.178,62.48 c-0.023,0.029-0.034,0.059-0.057,0.087C1.655,160.602,0,163.787,0,167.39v193.07c0,6.5,5.27,11.771,11.77,11.771h438.496 c6.5,0,11.77-5.271,11.77-11.771V167.39C462.037,163.787,460.381,160.602,457.83,158.441z M408.516,134.615l16.873,21.005h-16.873 V134.615z M384.975,113.345v42.274H296.84c-2.514,0-4.955,0.805-6.979,2.293l-58.837,43.299l-58.849-43.305 c-2.023-1.482-4.466-2.287-6.978-2.287H77.061v-42.274H384.975z M53.523,155.62H36.65l16.873-21.005V155.62z M438.498,348.69H23.54 V179.16h137.796l62.711,46.148c4.15,3.046,9.805,3.052,13.954-0.005l62.698-46.144h137.799V348.69L438.498,348.69z"}))),jC=e=>M.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("g",{opacity:.6},M.createElement("path",{d:"M12 4L4 12M4 4L12 12",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}))),{color:Qt,cornerRadius:KF,spacing:ii}=j,Ou={sm:{h:28,p:`${ii.xs} ${ii.sm}`,text:"body-2"},md:{h:32,p:`6px ${ii.md}`,text:"body-2"},lg:{h:40,p:`${ii.sm} ${ii.lg}`,text:"body-1"}},hg=S.forwardRef(({label:e,color:t="primary",size:n="md",onClick:r,onDelete:o,avatar:i,icon:s,disabled:a,className:l},c)=>{const u=S.useRef(null),f=S.useMemo(()=>{switch(t){case"primary":return{bg:Qt.status.neutralTintLow,color:Qt.text.primary};case"accent":return{bg:Qt.status.accentTintLow,color:Qt.text.accent};case"warning":return{bg:Qt.status.warningTintLow,color:Qt.text.warning};case"positive":return{bg:Qt.status.positiveTintLow,color:Qt.text.positive};case"negative":return{bg:Qt.status.negativeTintLow,color:Qt.text.negative};case"transfer":return{bg:"var(--status-transfer-tint-low)",color:"var(--text-transfer)"};default:return{bg:Qt.status.neutralTintLow,color:Qt.text.primary}}},[t]),d=R.css({cursor:a?"not-allowed":r?"pointer":"default",opacity:a?.5:1,userSelect:"none",position:"relative",transition:"background-color 0.2s, opacity 0.2s","&:hover":a?void 0:{backgroundColor:f.bg}}),h=R.css({display:"inline-flex",cursor:"pointer",opacity:.6,"&:hover":{opacity:1}});return C.jsxs(G,{ref:g=>{u.current=g,typeof c=="function"?c(g):c&&(c.current=g)},row:!0,alignItems:"center",justifyContent:"center",gap:ii.sm,h:Ou[n].h,p:Ou[n].p,overflow:"hidden",borderRadius:KF.sm,backgroundColor:f.bg,color:f.color,onClick:r,className:R.cx(d,l),children:[r&&C.jsx($o,{}),i&&C.jsx(G,{w:20,h:20,borderRadius:"50%",overflow:"hidden",children:i}),s&&C.jsx(G,{children:s}),typeof e=="string"?C.jsx(se,{variant:Ou[n].text,colorName:t,textOverflow:"ellipsis",overflow:"hidden",children:e}):e,o&&!a&&C.jsx(se,{className:h,colorName:t,onClick:g=>{g.stopPropagation(),o(g)},children:C.jsx(jC,{})})]})});hg.displayName="Tag";const{color:Et,cornerRadius:as}=j,o0=R.css({borderColor:Et.border.negativePrimary}),Iu=R.css({cursor:"not-allowed",opacity:.5}),VC=R.css({display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"none",color:"#9ca3af","& svg":{width:20,height:20,transition:"transform 0.2s ease-in"}}),UF=R.css({[`& .${VC} svg`]:{transform:"rotateX(180deg)"}}),ct={"select-container":R.css({position:"relative",display:"inline-block",minWidth:120,"&.full-width":{width:"100%"}}),"full-width":R.css({width:"100%"}),"select-input":R.css({border:`1px solid ${Et.border.neutralAlphaBasic}`,borderRadius:as.md,cursor:"pointer",transition:"all 0.2s ease-in-out",boxSizing:"border-box",[`&:hover:not(.${Iu})`]:{borderColor:Et.border.neutralAlphaHigh,backgroundColor:Et.fill.neutralPrimaryHover},[`&:focus:not(.${Iu})`]:{outline:"none",borderColor:Et.border.accentPrimary},[`&.${o0}:focus`]:{boxShadow:`0 0 0 3px ${Et.effect.shadowS}`}}),"size-xs":R.css({minHeight:32,padding:"8px 8px 8px 12px",borderRadius:as.sm}),"size-sm":R.css({minHeight:40,padding:"10px 12px 10px 16px",borderRadius:as.sm}),"size-md":R.css({minHeight:48,padding:"14px 12px 14px 16px",borderRadius:as.md}),"background-primary":R.css({backgroundColor:Et.fill.bgPrimary}),"background-secondary":R.css({backgroundColor:Et.fill.bgSecondary}),error:o0,disabled:Iu,open:UF,"select-value":R.css({flex:1,color:Et.text.primary,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",alignSelf:"center",...me.common,...me.body2}),"select-value_xs":R.css({...me.common,...me.caption1}),hidden:R.css({visibility:"hidden"}),visible:R.css({visibility:"visible"}),"select-arrow":VC,"select-dropdown":R.css({marginTop:4,backgroundColor:Et.fill.bgPrimary,borderRadius:as.md,boxShadow:`0 4px 20px 0 ${Et.effect.shadowS}`,maxHeight:224,overflow:"hidden"}),"select-menu":R.css({maxHeight:224,overflowY:"auto",padding:"4px 0","&::-webkit-scrollbar":{width:3},"&::-webkit-scrollbar-track":{background:"#f1f1f1"},"&::-webkit-scrollbar-thumb":{background:"#c1c1c1",borderRadius:3,"&:hover":{background:Et.fill.neutralSecondary}}}),"select-menu-item":R.css({cursor:"pointer",transition:"background-color 0.15s ease-in-out",color:Et.text.primary,padding:10,overflow:"hidden",textOverflow:"ellipsis","&:hover":{backgroundColor:Et.fill.neutralSecondaryHover}}),"select-menu-item-first":R.css({"&:hover":{cursor:"auto",backgroundColor:"inherit"}}),selected:R.css({backgroundColor:Et.fill.neutralSecondary}),"overflow-tooltip-container":R.css({width:"100%",position:"relative"}),"overflow-tooltip-text":R.css({width:"100%",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}),"empty-block":R.css({textAlign:"center",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",padding:14})},GF={xs:R.css({width:16,height:16,"& svg":{width:16,height:16,transition:"transform 0.2s ease-in"}}),sm:R.css({}),md:R.css({})};function gg({value:e,onChange:t,multiple:n=!1,returnedValue:r,renderItem:o,renderInputItem:i,renderSingleInputItem:s,renderMultipleInputItem:a,renderDropdownItem:l,placeholder:c,items:u=[],fullWidth:f,size:d="md",showDefaultItem:h,disabled:g,label:p,firstItem:m,lastItem:x,observer:y,emptyText:v,onBlur:b,prompt:w,error:_,errorText:E,dropdownMaxWidth:T=400,dropdownMinWidth:k=120,minWidth:P=120,width:O,background:D="secondary",dropdownClassName:I}){const[$,H]=Fo(e,n?[]:null),[U,L]=S.useState(!1),{refs:N,floatingStyles:V}=fg({open:U,strategy:"fixed",middleware:[sg(4),lg({crossAxis:!0,fallbackAxisSideDirection:"start"}),ag({crossAxis:!0,padding:8}),TF({apply({availableHeight:ee,availableWidth:Ce,elements:ze,rects:Re}){const mt=Math.min(typeof Ce=="number"?Ce-64:T,T),Ft=Re.reference.width,Yt=Math.max(Ft,k);Object.assign(ze.floating.style,{maxHeight:typeof ee=="number"?`${ee}px`:"auto",maxWidth:`${mt}px`,minWidth:`${Yt}px`,width:"max-content"})}})],whileElementsMounted:ig}),K=S.useMemo(()=>n?$||[]:$!=null?[$]:[],[$,n]),te=S.useCallback(ee=>r?r(ee):ee,[r]),J=S.useMemo(()=>{const ee=new Map;return u.forEach(Ce=>{ee.set(te(Ce),Ce)}),ee},[u,te]),Z=!u.length&&!_,ae=S.useMemo(()=>K.map(ee=>J.get(ee)).filter(ee=>!!ee),[J,K]);S.useEffect(()=>{process.env.NODE_ENV!=="production"&&o&&!l&&console.warn("[Select] `renderItem` deprecated, use `renderDropdownItem` instead.")},[l,o]);const oe=S.useCallback((ee,Ce)=>l?l(ee,Ce):o?o(ee):String(ee),[l,o]),fe=()=>{L(!1),b?.()},Te=ee=>{const Ce=te(ee);if(n){const ze=K.includes(Ce)?K.filter(Re=>Re!==Ce):[...K,Ce];H(ze),t?.(ze)}else H(Ce),t?.(Ce),fe()},ne=ee=>{if(!n)return;const Ce=K.filter(ze=>ze!==ee);H(Ce),t?.(Ce)},ve=()=>{const ee=n?[]:null;H(ee),t?.(ee),n||fe()},Ee=()=>typeof c=="string"?C.jsx(se,{variant:d==="xs"?"caption-1":"body-2",textOverflow:"ellipsis",overflow:"hidden",colorName:"tertiary",children:c??"Select..."}):c,De=()=>{if(!K.length)return Ee();if(n)return a?a(ae):i?i({mode:"multiple",selectedItems:ae}):C.jsx(G,{flexWrap:"wrap",row:!0,gap:10,children:K.map(ze=>{const Re=J.get(ze);return Re?C.jsx(hg,{size:"sm",label:o?o(Re):String(ze),onDelete:mt=>{mt.stopPropagation(),ne(ze)}},ze):null})});const ee=J.get(K[0])??null;if(!ee)return Ee();if(s)return s(ee);if(i)return i({mode:"single",selectedItem:ee});const Ce=o?o(ee):String(K[0]);return typeof Ce=="string"?C.jsx(se,{variant:d==="xs"?"caption-1":"body-2",tag:"p",textOverflow:"ellipsis",overflow:"hidden",children:Ce}):C.jsx(C.Fragment,{children:Ce})},st=U&&C.jsx(Gi,{children:C.jsx(G,{row:!0,top:0,right:0,bottom:0,left:0,position:"fixed",center:!0,flex:1,onClick:fe,display:"block",backgroundColor:"transparent",zIndex:1,children:C.jsx(Us.div,{ref:N.setFloating,className:R.cx(ct["select-dropdown"],I),initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.25,ease:"easeInOut"},style:{...V,zIndex:1},onMouseDown:ee=>ee.stopPropagation(),onClick:ee=>ee.stopPropagation(),children:C.jsxs("ul",{className:ct["select-menu"],children:[h&&!n&&C.jsx(G,{className:ct["select-menu-item"],role:"option",onClick:ve,children:C.jsx(se,{variant:"body-2",colorName:"tertiary",children:c})}),m&&C.jsx(G,{className:R.cx(ct["select-menu-item"],ct["select-menu-item-first"]),children:m}),Z&&C.jsxs(G,{className:ct["empty-block"],children:[C.jsx(G,{w:20,h:20,children:C.jsx(WF,{})}),C.jsx(se,{variant:"body-2",children:v??"There is nothing yet"})]}),u.map((ee,Ce)=>{const ze=te(ee),Re=K.includes(ze),mt=oe(ee,{item:ee,selected:Re,index:Ce}),Ft=typeof mt=="string";return C.jsxs(G,{row:!0,gap:10,alignItems:"center",className:R.cx(ct["select-menu-item"],{[ct.selected]:Re}),role:"option",relative:!0,onClick:()=>Te(ee),children:[n&&C.jsx(ih,{size:"sm",checked:Re}),Ft?C.jsx(se,{variant:"body-2",tag:"p",wordBreak:"break-all",whiteSpace:"break-spaces",children:mt}):mt,C.jsx($o,{})]},ze)}),y,x&&C.jsx(G,{className:R.cx(ct["select-menu-item"],ct["select-menu-item-first"]),children:x})]})},"dropdown")})});return C.jsxs(G,{relative:!0,display:"inline-block",minWidth:P,w:O||(f?"full":"auto"),onMouseDown:ee=>ee.stopPropagation(),onClick:ee=>ee.stopPropagation(),children:[typeof p=="string"?C.jsx(se,{variant:"body-2",colorName:"tertiary",fontWeight:"regular",mb:d==="sm"?4:8,children:p}):p,C.jsxs(G,{ref:N.setReference,row:!0,gap:10,tabIndex:g?-1:0,role:"button",alignItems:"flex-start","aria-haspopup":"listbox",relative:!0,w:"100%",className:R.cx(ct["select-input"],ct[`size-${d}`],ct[`background-${D}`],{[ct.error]:_,[ct.disabled]:g,[ct.open]:U}),onClick:()=>!g&&L(ee=>!ee),children:[C.jsx(G,{className:R.cx(ct["select-value"]),children:De()}),C.jsx(G,{className:R.cx(ct["select-arrow"],GF[d]),children:C.jsx(HF,{})})]}),typeof w=="string"?C.jsx(se,{variant:"caption-1",colorName:"tertiary",mt:4,children:w}):w,_&&E&&C.jsx(se,{tag:"p",colorName:"negative",variant:"body-2",mt:5,children:E}),C.jsx(Lx,{children:st})]})}const qF=e=>M.createElement("svg",{width:10,height:10,viewBox:"0 0 10 10",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("path",{d:"M3.94629 0.220237C3.78013 0.264025 3.64089 0.377624 3.56348 0.53176C3.27371 1.11189 3.05664 1.46395 2.83887 1.74953C2.61807 2.03873 2.38547 2.27579 2.03027 2.63039C1.21079 3.45057 0.799805 4.52619 0.799805 5.60012C0.799838 6.67406 1.21073 7.74968 2.03027 8.56985C3.67062 10.2096 6.32931 10.2095 7.96973 8.56985C8.78929 7.74968 9.20016 6.67408 9.2002 5.60012C9.15131 4.32908 8.43217 3.48543 7.94727 3.05813C7.76902 2.90106 7.40643 3.02424 7.2627 3.2134C7.24031 3.24286 7.21612 3.2739 7.18945 3.30617C6.93211 3.61754 6.56236 3.80807 6.41504 3.83156C6.38264 3.83667 6.36979 3.76513 6.2959 3.58254C5.79455 2.34427 5.78927 2.49365 5.58887 2.01125C5.48847 1.7692 5.05517 1.02727 4.92676 0.828635C4.80206 0.635591 4.64095 0.439873 4.43359 0.301292C4.29028 0.205951 4.1124 0.175957 3.94629 0.220237ZM4.75293 4.17824C5.2689 4.63997 5.60857 5.26651 5.71484 5.95071C6.10631 5.85571 6.46727 5.68318 6.78125 5.45071C6.86578 5.70826 6.89338 5.98123 6.8623 6.25051C6.83115 6.51993 6.74174 6.77966 6.60059 7.01125C6.45944 7.24281 6.27008 7.44117 6.04492 7.59231C5.81977 7.74344 5.56462 7.8443 5.29688 7.88723C5.0292 7.93013 4.75518 7.91446 4.49414 7.84133C4.23299 7.76812 3.99064 7.6383 3.78418 7.46242C3.5778 7.28657 3.41161 7.06792 3.29785 6.8218C3.18419 6.57572 3.12519 6.30771 3.125 6.03664C3.12508 5.58233 3.29054 5.14308 3.58984 4.80129C3.88917 4.4597 4.30271 4.2382 4.75293 4.17824Z",fill:"#FEAD34"})),YF=e=>M.createElement("svg",{width:12,height:12,viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("path",{d:"M10.1483 8.61509C10.3344 8.26159 9.98299 7.89856 9.58534 7.93723C9.42671 7.95265 9.25857 7.9605 9.07422 7.96035C6.36522 7.9582 4.17129 5.76427 4.16914 3.05527C4.169 2.87115 4.17682 2.70321 4.19221 2.54477C4.23082 2.14712 3.86769 1.79411 3.50976 1.97161C2.03398 2.70343 1.20002 4.02274 1.20002 5.89477C1.20002 8.60377 3.3961 10.7998 6.1051 10.7998C7.97571 10.7998 9.38737 10.06 10.1483 8.61509Z",fill:"white"})),{color:en,cornerRadius:i0,height:Du,spacing:XF,transition:s0}=j,Pn={container:R.css({width:"100%",cursor:"pointer",outline:"none",userSelect:"none",display:"flex",justifyContent:"space-between",gap:XF.md,"&.disabled":{cursor:"not-allowed",opacity:.5},"&.reverse":{flexDirection:"row-reverse"}}),disabled:R.css({cursor:"not-allowed",opacity:.5}),reverse:R.css({flexDirection:"row-reverse"}),switchContainer:R.css({"--width-switch-sm":"34px","--width-switch-md":"40px","--width-switch-lg":"52px","--size-thumb-sm":"18px","--size-thumb-md":"20px","--size-thumb-lg":"28px","--thumb-translate":"0px","&:has(input:checked)":{"--thumb-translate":"calc(var(--switch-width) - var(--thumb-width) - 4px)"}}),variant_accent:R.css({"&:has(input:not(:checked))":{"--switch-bg-color":en.fill.bgTertiary,"--thumb-bg-color":en.fill.bgPrimary},"&:has(input:checked)":{"--switch-bg-color":en.fill.accentPrimary,"--thumb-bg-color":en.fill.bgPrimary}}),variant_secondary:R.css({"&:has(input:not(:checked))":{"--switch-bg-color":en.fill.bgTertiary,"--thumb-bg-color":en.fill.bgPrimary},"&:has(input:checked)":{"--switch-bg-color":en.fill.accentSecondary,"--thumb-bg-color":en.fill.accentPrimary}}),variant_theme:R.css({"&:has(input:not(:checked))":{"--switch-bg-color":en.fill.bgTertiary,"--thumb-bg-color":en.fill.bgPrimary},"&:has(input:checked)":{"--switch-bg-color":en.fill.bgSecondary,"--thumb-bg-color":en.fill.bgTertiary}}),size_sm:R.css({"--switch-width":"var(--width-switch-sm)","--switch-height":Du.switch.sm,"--thumb-width":"var(--size-thumb-sm)","--thumb-height":"var(--size-thumb-sm)"}),size_md:R.css({"--switch-width":"var(--width-switch-md)","--switch-height":Du.switch.md,"--thumb-width":"var(--size-thumb-md)","--thumb-height":"var(--size-thumb-md)"}),size_lg:R.css({"--switch-width":"var(--width-switch-lg)","--switch-height":Du.switch.lg,"--thumb-width":"var(--size-thumb-lg)","--thumb-height":"var(--size-thumb-lg)"}),switch:R.css({width:"var(--switch-width)",height:"var(--switch-height)",transition:s0.general,display:"flex",alignItems:"center",padding:2,backgroundColor:"var(--switch-bg-color)",borderRadius:i0.xl}),thumb:R.css({display:"flex",alignItems:"center",justifyContent:"center",padding:4,transition:s0.general,transform:"translateX(var(--thumb-translate, 0))",width:"var(--thumb-width)",height:"var(--thumb-height)",backgroundColor:"var(--thumb-bg-color)",borderRadius:i0.fullRound}),moon:R.css({width:"100%",height:"100%"}),fire:R.css({width:"100%",height:"100%"})},{spacing:a0}=j,BC=S.forwardRef(({title:e,text:t,icon:n,disabled:r,onChange:o,checked:i,defaultValue:s,className:a,size:l="md",variant:c="accent",reverse:u=!1,w:f="auto",...d},h)=>{const[g,p]=Fo(i,s),m=S.useRef(null);S.useImperativeHandle(h,()=>({focus:()=>{m.current?.focus()},blur:()=>{m.current?.blur()},get checked(){return g??!1},setChecked:b=>{p(b),o?.(b)},toggle:()=>{const b=!g;p(b),o?.(b)},isFocused:()=>document.activeElement===m.current,isDisabled:()=>r??!1,getInputElement:()=>m.current,checkValidity:()=>m.current?.checkValidity()??!0,reset:()=>{const b=s??!1;p(b),o?.(b)}}),[g,p,o,r,s]);const x=S.useCallback(b=>{p(b.target.checked),o?.(b.target.checked)},[o]),y=S.useMemo(()=>typeof e=="string"?C.jsx(se,{variant:"body-1",colorName:"primary",fontWeight:"medium",children:e}):e,[e]),v=S.useMemo(()=>typeof t=="string"?C.jsx(se,{variant:"body-2",colorName:"secondary",fontWeight:"regular",children:t}):t,[t]);return C.jsxs(G,{row:!0,w:f,gap:a0.sm,children:[C.jsxs("label",{className:R.cx(Pn.container,a,{[Pn.disabled]:r,[Pn.reverse]:u}),children:[C.jsxs(G,{className:R.cx(Pn.switchContainer,Pn[`size_${l}`],Pn[`variant_${c}`]),children:[C.jsx("input",{ref:m,type:"checkbox",checked:g,hidden:!0,onChange:x,disabled:r,...d}),C.jsx("div",{className:Pn.switch,children:C.jsx("div",{className:Pn.thumb,children:c==="theme"&&(g?C.jsx(YF,{className:Pn.moon}):C.jsx(qF,{className:Pn.fire}))})})]}),(y||v)&&C.jsxs(G,{gap:a0.xs,children:[y,v]})]}),n]})});BC.displayName="Switch";const{spacing:l0}=j,ZF=R.css({cursor:"pointer",userSelect:"none"}),JF=R.css({cursor:"not-allowed",opacity:.5}),QF=R.css({transition:"color 0.2s ease"}),e$=S.forwardRef(({label:e,selected:t,disabled:n,fullWidth:r,onClick:o},i)=>C.jsx(G,{w:r?"full":void 0,justifyContent:"center",alignItems:"center",ref:i,py:l0.md,px:l0.xl,onClick:o,className:R.cx(ZF,{[JF]:n}),children:C.jsx(se,{className:QF,colorName:t?"primary":"tertiary",fontWeight:"medium",variant:"body-2",children:e})})),{color:zC}=j,t$=R.css({borderBottom:`1px solid ${zC.border.neutralAlphaBasic}`}),HC=({value:e,onChange:t,options:n,fullWidth:r=!1,className:o})=>{const[i,s]=S.useState({left:0,width:0}),a=S.useRef([]),l=u=>f=>{a.current[u]=f};S.useEffect(()=>{const u=n.findIndex(d=>d.value===e),f=a.current[u];f&&s({left:f.offsetLeft,width:f.offsetWidth})},[e,n]);const c=(u,f=!1)=>()=>!f&&t(u);return C.jsxs(G,{row:!0,w:r?"full":"auto",relative:!0,className:R.cx(t$,o),children:[n.map((u,f)=>C.jsx(e$,{selected:e===u.value,onClick:c(u.value,u.disabled),ref:l(f),label:u.label,disabled:u.disabled,fullWidth:r},u.value)),C.jsx(G,{h:2,w:i.width,absolute:!0,bottom:-1,left:i.left,backgroundColor:zC.border.accentPrimary,className:R.css({transition:"left 0.2s ease, width 0.2s ease"})})]})};HC.displayName="Tabs";const WC=S.forwardRef(({title:e,subtitle:t,w:n="full",p:r,py:o,px:i=j.spacing["2xl"],pt:s=j.spacing["2xl"],pb:a=j.spacing.lg,row:l=!0,justifyContent:c="space-between",showCloseButton:u=!1},f)=>{const{onClose:d}=U_();return C.jsxs(G,{w:n,p:r,py:o,px:i,pt:s,pb:a,row:l,justifyContent:c,ref:f,borderColor:j.color.border.neutralAlphaBasic,borderWidth:0,borderBottomWidth:1,borderStyle:"solid",children:[C.jsxs(G,{gap:j.spacing.sm,children:[C.jsx(se,{variant:"title-3",colorName:"primary",fontWeight:"semibold",children:e}),C.jsx(se,{variant:"body-1",colorName:"tertiary",fontWeight:"medium",children:t})]}),u&&C.jsx(G,{children:C.jsx(fr,{onClick:d,color:"neutral",children:C.jsx(O0,{})})})]})});WC.displayName="ModalHeader";function Xo(e,t,n){let r=n.initialDeps??[],o,i=!0;function s(){var a,l,c;let u;n.key&&((a=n.debug)!=null&&a.call(n))&&(u=Date.now());const f=e();if(!(f.length!==r.length||f.some((g,p)=>r[p]!==g)))return o;r=f;let h;if(n.key&&((l=n.debug)!=null&&l.call(n))&&(h=Date.now()),o=t(...f),n.key&&((c=n.debug)!=null&&c.call(n))){const g=Math.round((Date.now()-u)*100)/100,p=Math.round((Date.now()-h)*100)/100,m=p/16,x=(y,v)=>{for(y=String(y);y.length<v;)y=" "+y;return y};console.info(`%c⏱ ${x(p,5)} /${x(g,5)} ms`,`
63
+ `)}})(e,n)(t)}function DM({defaultSelection:e}){const[t]=lt();return S.useEffect(()=>{t.focus(()=>{const n=document.activeElement,r=t.getRootElement();r===null||n!==null&&r.contains(n)||r.focus({preventScroll:!0})},{defaultSelection:e})},[e,t]),null}const qw=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,jM=qw?S.useLayoutEffect:S.useEffect,ja={tag:Ei};function Yw({initialConfig:e,children:t}){const n=S.useMemo(()=>{const{theme:r,namespace:o,nodes:i,onError:s,editorState:a,html:l}=e,c=c3(null,r),u=E1({editable:e.editable,html:l,namespace:o,nodes:i,onError:f=>s(f,u),theme:r});return(function(f,d){if(d!==null){if(d===void 0)f.update(()=>{const h=qe();if(h.isEmpty()){const g=ve();h.append(g);const p=qw?document.activeElement:null;(X()!==null||p!==null&&p===f.getRootElement())&&g.select()}},ja);else if(d!==null)switch(typeof d){case"string":{const h=f.parseEditorState(d);f.setEditorState(h,ja);break}case"object":f.setEditorState(d,ja);break;case"function":f.update(()=>{qe().isEmpty()&&d(f)},ja)}}})(u,a),[u,c]},[]);return jM(()=>{const r=e.editable,[o]=n;o.setEditable(r===void 0||r)},[]),C.jsx(Ab.Provider,{value:n,children:t})}function VM(){return qe().getTextContent()}function BM(e,t=!0){if(e)return!1;let n=VM();return t&&(n=n.trim()),n===""}function zM(e){if(!BM(e,!1))return!1;const t=qe().getChildren(),n=t.length;if(n>1)return!1;for(let r=0;r<n;r++){const o=t[r];if(Te(o))return!1;if(B(o)){if(!Qr(o)||o.__indent!==0)return!1;const i=o.getChildren(),s=i.length;for(let a=0;a<s;a++){const l=i[r];if(!J(l))return!1}}}return!0}function Xw(e){return()=>zM(e)}function HM(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const o of t)r.append("v",o);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function WM(e,t,n,r){const o=s=>s instanceof n,i=s=>{const a=Fe(s.getTextContent());a.setFormat(s.getFormat()),s.replace(a)};return[e.registerNodeTransform(fn,s=>{if(!s.isSimpleText())return;let a,l=s.getPreviousSibling(),c=s.getTextContent(),u=s;if(J(l)){const d=l.getTextContent(),h=t(d+c);if(o(l)){if(h===null||(g=>g.getLatest().__mode)(l)!==0)return void i(l);{const g=h.end-d.length;if(g>0){const p=d+c.slice(0,g);if(l.select(),l.setTextContent(p),g===c.length)s.remove();else{const m=c.slice(g);s.setTextContent(m)}return}}}else if(h===null||h.start<d.length)return}let f=0;for(;;){a=t(c);let d,h=a===null?"":c.slice(a.end);if(c=h,h===""){const p=u.getNextSibling();if(J(p)){h=u.getTextContent()+p.getTextContent();const m=t(h);if(m===null)return void(o(p)?i(p):p.markDirty());if(m.start!==0)return}}if(a===null)return;if(a.start===0&&J(l)&&l.isTextEntity()){f+=a.end;continue}a.start===0?[d,u]=u.splitText(a.end):[,d,u]=u.splitText(a.start+f,a.end+f),d===void 0&&HM(165,"nodeToReplace");const g=r(d);if(g.setFormat(d.getFormat()),d.replace(g),u==null)return;f=0,l=g}}),e.registerNodeTransform(n,s=>{const a=s.getTextContent(),l=t(a);if(l===null||l.start!==0)return void i(s);if(a.length>l.end)return void s.splitText(l.end);const c=s.getPreviousSibling();J(c)&&c.isTextEntity()&&(i(c),i(s));const u=s.getNextSibling();J(u)&&u.isTextEntity()&&(i(u),o(s)&&i(s))})]}let pc=class Zw extends fn{static getType(){return"hashtag"}static clone(t){return new Zw(t.__text,t.__key)}createDOM(t){const n=super.createDOM(t);return et(n,t.theme.hashtag),n}static importJSON(t){return Jw().updateFromJSON(t)}canInsertTextBefore(){return!1}isTextEntity(){return!0}};function Jw(e=""){return Et(new pc(e))}const KM=new RegExp((function(){const{alpha:e,alphanumeric:t,hashChars:n}=(function(){const o=String.fromCharCode,i="A-Za-zªµºÀ-ÖØ-öø-Ɂɐ-ˁˆ-ˑˠ-ˤˮͺΆΈ-ΊΌΎ-ΡΣ-ώϐ-ϵϷ-ҁҊ-ӎӐ-ӹԀ-ԏԱ-Ֆՙա-ևא-תװ-ײء-غـ-يٮ-ٯٱ-ۓەۥ-ۦۮ-ۯۺ-ۼۿܐܒ-ܯݍ-ݭހ-ޥޱऄ-हऽॐक़-ॡॽঅ-ঌএ-ঐও-নপ-রলশ-হঽৎড়-ঢ়য়-ৡৰ-ৱਅ-ਊਏ-ਐਓ-ਨਪ-ਰਲ-ਲ਼ਵ-ਸ਼ਸ-ਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલ-ળવ-હઽૐૠ-ૡଅ-ଌଏ-ଐଓ-ନପ-ରଲ-ଳଵ-ହଽଡ଼-ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கங-சஜஞ-டண-தந-பம-ஹఅ-ఌఎ-ఐఒ-నప-ళవ-హౠ-ౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠ-ೡഅ-ഌഎ-ഐഒ-നപ-ഹൠ-ൡඅ-ඖක-නඳ-රලව-ෆก-ะา-ำเ-ๆກ-ຂຄງ-ຈຊຍດ-ທນ-ຟມ-ຣລວສ-ຫອ-ະາ-ຳຽເ-ໄໆໜ-ໝༀཀ-ཇཉ-ཪྈ-ྋက-အဣ-ဧဩ-ဪၐ-ၕႠ-Ⴥა-ჺჼᄀ-ᅙᅟ-ᆢᆨ-ᇹሀ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙶᚁ-ᚚᚠ-ᛪᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᤀ-ᤜᥐ-ᥭᥰ-ᥴᦀ-ᦩᧁ-ᧇᨀ-ᨖᴀ-ᶿḀ-ẛẠ-ỹἀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₔℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℱℳ-ℹℼ-ℿⅅ-ⅉⰀ-Ⱞⰰ-ⱞⲀ-ⳤⴀ-ⴥⴰ-ⵥⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〆〱-〵〻-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄬㄱ-ㆎㆠ-ㆷㇰ-ㇿ㐀-䶵一-龻ꀀ-ꒌꠀ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢ가-힣豈-鶴侮-頻並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּ-סּףּ-פּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵÀ-ÖØ-öø-ÿĀ-ɏɓ-ɔɖ-ɗəɛɣɨɯɲʉʋʻ̀-ͯḀ-ỿЀ-ӿԀ-ԧⷠ-ⷿꙀ-֑ꚟ-ֿׁ-ׂׄ-ׇׅא-תװ-״﬒-ﬨשׁ-זּטּ-לּמּנּ-סּףּ-פּצּ-ﭏؐ-ؚؠ-ٟٮ-ۓە-ۜ۞-۪ۨ-ۯۺ-ۼۿݐ-ݿࢠࢢ-ࢬࣤ-ࣾﭐ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼ‌-‌ก-ฺเ-๎ᄀ-ᇿ㄰-ㆅꥠ-꥿가-힯ힰ-퟿ᄀ-ᅵァ-ヺー-ヾヲ-゚0-9A-Za-zぁ-ゖ゙-ゞ㐀-䶿一-鿿"+o(173824)+"-"+o(177983)+o(177984)+"-"+o(178207)+o(194560)+"-"+o(195103)+"〃々〻";return{alpha:i,alphanumeric:i+"̀-ͯ҃-֑҆-ֹֻ-ֽֿׁ-ׂׄ-ׇׅؐ-ًؕ-ٰٞۖ-ۜ۟-ۤۧ-۪ۨ-ܑۭܰ-݊ަ-ްँ-ः़ा-्॑-॔ॢ-ॣঁ-ঃ়া-ৄে-ৈো-্ৗৢ-ৣਁ-ਃ਼ਾ-ੂੇ-ੈੋ-੍ੰ-ੱઁ-ઃ઼ા-ૅે-ૉો-્ૢ-ૣଁ-ଃ଼ା-ୃେ-ୈୋ-୍ୖ-ୗஂா-ூெ-ைொ-்ௗఁ-ఃా-ౄె-ైొ-్ౕ-ౖಂ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕ-ೖം-ഃാ-ൃെ-ൈൊ-്ൗං-ඃ්ා-ුූෘ-ෟෲ-ෳัิ-ฺ็-๎ັິ-ູົ-ຼ່-ໍ༘-༹༙༵༷༾-༿ཱ-྄྆-྇ྐ-ྗྙ-ྼ࿆ာ-ဲံ-္ၖ-ၙ፟ᜒ-᜔ᜲ-᜴ᝒ-ᝓᝲ-ᝳា-៓៝᠋-᠍ᢩᤠ-ᤫᤰ-᤻ᦰ-ᧀᧈ-ᧉᨗ-ᨛ᷀-᷃⃐-⃥⃜⃡-⃫〪-゙〯-゚ꠂ꠆ꠋꠣ-ꠧﬞ︀-️︠-︣0-9٠-٩۰-۹०-९০-৯੦-੯૦-૯୦-୯௦-௯౦-౯೦-೯൦-൯๐-๙໐-໙༠-༩၀-၉០-៩᠐-᠙᥆-᥏᧐-᧙0-9_",hashChars:"#\\uFF03"}})(),r="["+t+"]";return"("+("^|$|[^&/"+t+"]")+")("+("["+n+"]")+")("+r+"*"+("["+e+"]")+r+"*)"})(),"i"),UM={getHashtagMatch:function(e){const t=KM.exec(e);if(t===null)return null;const n=t[3].length+1,r=t.index+t[1].length;return{end:r+n,start:r}}};function GM(e,t=UM){return Nn(...WM(e,t.getHashtagMatch,pc,n=>Jw(n.getTextContent())))}function qM(){const[e]=lt();return S.useEffect(()=>{if(!e.hasNodes([pc]))throw new Error("HashtagPlugin: HashtagNode not registered on editor");return GM(e)},[e]),null}function YM({hasStrictIndent:e=!1}){const[t]=lt();return S.useEffect(()=>{if(!t.hasNodes([Uo,eo]))throw new Error("ListPlugin: ListNode and/or ListItemNode not registered on editor")},[t]),S.useEffect(()=>{if(e)return RN(t)},[t,e]),(function(n){S.useEffect(()=>EN(n),[n])})(t),null}function Yy(e,t){return e.getEditorState().read(()=>{const n=Pe(t);return n!==null&&n.isSelected()})}function XM(e){const[t]=lt(),[n,r]=S.useState(()=>Yy(t,e));return S.useEffect(()=>{let o=!0;const i=t.registerUpdateListener(()=>{o&&r(Yy(t,e))});return()=>{o=!1,i()}},[t,e]),[n,S.useCallback(o=>{t.update(()=>{let i=X();Ct(i)||(i=Eh(),Ge(i)),Ct(i)&&(o?i.add(e):i.delete(e))})},[t,e]),S.useCallback(()=>{t.update(()=>{const o=X();Ct(o)&&o.clear()})},[t])]}function ZM({nodeKey:e}){const[t]=lt(),[n,r,o]=XM(e);return S.useEffect(()=>Nn(t.registerCommand(Ql,i=>{const s=t.getElementByKey(e);return i.target===s&&(i.shiftKey||o(),r(!n),!0)},ur)),[o,t,n,e,r]),S.useEffect(()=>{const i=t.getElementByKey(e),s=t._config.theme.hrSelected??"selected";i!==null&&(n?et(i,s):Yn(i,s))},[t,n,e]),null}let Qw=class eC extends Yh{static getType(){return"horizontalrule"}static clone(t){return new eC(t.__key)}static importJSON(t){return tg().updateFromJSON(t)}static importDOM(){return{hr:()=>({conversion:JM,priority:0})}}decorate(){return C.jsx(ZM,{nodeKey:this.__key})}};function JM(){return{node:tg()}}function tg(){return Et(new Qw)}const QM=[{dependencies:[Qw],export:e=>mN(e)?"***":null,regExp:/^(---|\*\*\*|___)\s?$/,replace:(e,t,n,r)=>{const o=tg();r||e.getNextSibling()!=null?e.replace(o):e.insertBefore(o),o.selectNext()},type:"element"},...ha];function eP({transformers:e=QM}){const[t]=lt();return S.useEffect(()=>OM(t,e),[t,e]),null}const tP=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?S.useLayoutEffect:S.useEffect;function nP({ignoreHistoryMergeTagChange:e=!0,ignoreSelectionChange:t=!1,onChange:n}){const[r]=lt();return tP(()=>{if(n)return r.registerUpdateListener(({editorState:o,dirtyElements:i,dirtyLeaves:s,prevEditorState:a,tags:l})=>{t&&i.size===0&&s.size===0||e&&l.has(Ei)||a.isEmpty()||n(o,r,l)})},[r,e,t,n]),null}const ng=/^(\d+(?:\.\d+)?)px$/,st={BOTH:3,COLUMN:2,NO_STATUS:0,ROW:1};class Mn extends Tt{__colSpan;__rowSpan;__headerState;__width;__backgroundColor;__verticalAlign;static getType(){return"tablecell"}static clone(t){return new Mn(t.__headerState,t.__colSpan,t.__width,t.__key)}afterCloneFrom(t){super.afterCloneFrom(t),this.__rowSpan=t.__rowSpan,this.__backgroundColor=t.__backgroundColor,this.__verticalAlign=t.__verticalAlign}static importDOM(){return{td:t=>({conversion:Xy,priority:0}),th:t=>({conversion:Xy,priority:0})}}static importJSON(t){return un().updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setHeaderStyles(t.headerState).setColSpan(t.colSpan||1).setRowSpan(t.rowSpan||1).setWidth(t.width||void 0).setBackgroundColor(t.backgroundColor||null).setVerticalAlign(t.verticalAlign||void 0)}constructor(t=st.NO_STATUS,n=1,r,o){super(o),this.__colSpan=n,this.__rowSpan=1,this.__headerState=t,this.__width=r,this.__backgroundColor=null,this.__verticalAlign=void 0}createDOM(t){const n=document.createElement(this.getTag());return this.__width&&(n.style.width=`${this.__width}px`),this.__colSpan>1&&(n.colSpan=this.__colSpan),this.__rowSpan>1&&(n.rowSpan=this.__rowSpan),this.__backgroundColor!==null&&(n.style.backgroundColor=this.__backgroundColor),hf(this.__verticalAlign)&&(n.style.verticalAlign=this.__verticalAlign),et(n,t.theme.tableCell,this.hasHeader()&&t.theme.tableCellHeader),n}exportDOM(t){const n=super.exportDOM(t);if(Be(n.element)){const r=n.element;r.setAttribute("data-temporary-table-cell-lexical-key",this.getKey()),r.style.border="1px solid black",this.__colSpan>1&&(r.colSpan=this.__colSpan),this.__rowSpan>1&&(r.rowSpan=this.__rowSpan),r.style.width=`${this.getWidth()||75}px`,r.style.verticalAlign=this.getVerticalAlign()||"top",r.style.textAlign="start",this.__backgroundColor===null&&this.hasHeader()&&(r.style.backgroundColor="#f2f3f5")}return n}exportJSON(){return{...super.exportJSON(),...hf(this.__verticalAlign)&&{verticalAlign:this.__verticalAlign},backgroundColor:this.getBackgroundColor(),colSpan:this.__colSpan,headerState:this.__headerState,rowSpan:this.__rowSpan,width:this.getWidth()}}getColSpan(){return this.getLatest().__colSpan}setColSpan(t){const n=this.getWritable();return n.__colSpan=t,n}getRowSpan(){return this.getLatest().__rowSpan}setRowSpan(t){const n=this.getWritable();return n.__rowSpan=t,n}getTag(){return this.hasHeader()?"th":"td"}setHeaderStyles(t,n=st.BOTH){const r=this.getWritable();return r.__headerState=t&n|r.__headerState&~n,r}getHeaderStyles(){return this.getLatest().__headerState}setWidth(t){const n=this.getWritable();return n.__width=t,n}getWidth(){return this.getLatest().__width}getBackgroundColor(){return this.getLatest().__backgroundColor}setBackgroundColor(t){const n=this.getWritable();return n.__backgroundColor=t,n}getVerticalAlign(){return this.getLatest().__verticalAlign}setVerticalAlign(t){const n=this.getWritable();return n.__verticalAlign=t||void 0,n}toggleHeaderStyle(t){const n=this.getWritable();return(n.__headerState&t)===t?n.__headerState-=t:n.__headerState+=t,n}hasHeaderState(t){return(this.getHeaderStyles()&t)===t}hasHeader(){return this.getLatest().__headerState!==st.NO_STATUS}updateDOM(t){return t.__headerState!==this.__headerState||t.__width!==this.__width||t.__colSpan!==this.__colSpan||t.__rowSpan!==this.__rowSpan||t.__backgroundColor!==this.__backgroundColor||t.__verticalAlign!==this.__verticalAlign}isShadowRoot(){return!0}collapseAtStart(){return!0}canBeEmpty(){return!1}canIndent(){return!1}}function hf(e){return e==="middle"||e==="bottom"}function Xy(e){const t=e,n=e.nodeName.toLowerCase();let r;ng.test(t.style.width)&&(r=parseFloat(t.style.width));const o=un(n==="th"?st.ROW:st.NO_STATUS,t.colSpan,r);o.__rowSpan=t.rowSpan;const i=t.style.backgroundColor;i!==""&&(o.__backgroundColor=i);const s=t.style.verticalAlign;hf(s)&&(o.__verticalAlign=s);const a=t.style,l=(a&&a.textDecoration||"").split(" "),c=a.fontWeight==="700"||a.fontWeight==="bold",u=l.includes("line-through"),f=a.fontStyle==="italic",d=l.includes("underline");return{after:h=>{const g=[];let p=null;const m=()=>{if(p){const v=p.getFirstChild();Kn(v)&&p.getChildrenSize()===1&&v.remove()}};for(const v of h)TA(v)||J(v)||Kn(v)?(J(v)&&(c&&v.toggleFormat("bold"),u&&v.toggleFormat("strikethrough"),f&&v.toggleFormat("italic"),d&&v.toggleFormat("underline")),p?p.append(v):(p=ve().append(v),g.push(p))):(g.push(v),m(),p=null);return m(),g.length===0&&g.push(ve()),g},node:o}}function un(e=st.NO_STATUS,t=1,n){return Et(new Mn(e,t,n))}function ge(e){return e instanceof Mn}const tC=ce("INSERT_TABLE_COMMAND");function fe(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const o of t)r.append("v",o);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}class Ur extends Tt{__height;static getType(){return"tablerow"}static clone(t){return new Ur(t.__height,t.__key)}static importDOM(){return{tr:t=>({conversion:rP,priority:0})}}static importJSON(t){return Di().updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setHeight(t.height)}constructor(t,n){super(n),this.__height=t}exportJSON(){const t=this.getHeight();return{...super.exportJSON(),...t===void 0?void 0:{height:t}}}createDOM(t){const n=document.createElement("tr");return this.__height&&(n.style.height=`${this.__height}px`),et(n,t.theme.tableRow),n}extractWithChild(t,n,r){return r==="html"}isShadowRoot(){return!0}setHeight(t){const n=this.getWritable();return n.__height=t,n}getHeight(){return this.getLatest().__height}updateDOM(t){return t.__height!==this.__height}canBeEmpty(){return!1}canIndent(){return!1}}function rP(e){const t=e;let n;return ng.test(t.style.height)&&(n=parseFloat(t.style.height)),{after:r=>aw(r,ge),node:Di(n)}}function Di(e){return Et(new Ur(e))}function tt(e){return e instanceof Ur}const rg=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,oP=rg&&"documentMode"in document?document.documentMode:null,Zy=rg&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent);function iP(e,t,n=!0){const r=yc();for(let o=0;o<e;o++){const i=Di();for(let s=0;s<t;s++){let a=st.NO_STATUS;typeof n=="object"?(o===0&&n.rows&&(a|=st.ROW),s===0&&n.columns&&(a|=st.COLUMN)):n&&(o===0&&(a|=st.ROW),s===0&&(a|=st.COLUMN));const l=un(a),c=ve();c.append(Fe()),l.append(c),i.append(l)}r.append(i)}return r}function sP(e){const t=we(e,n=>Ze(n));if(Ze(t))return t;throw new Error("Expected table cell to be inside of table.")}rg&&"InputEvent"in window&&!oP&&new window.InputEvent("input");const gf=(e,t)=>e===st.BOTH||e===t?t:st.NO_STATUS;function aP(e,t=!0){const[,,n]=zn(e),[r,o]=an(n,e,e),i=r[0].length,{startRow:s}=o;let a=null;if(t){const l=s+e.__rowSpan-1,c=r[l],u=Di();for(let d=0;d<i;d++){const{cell:h,startRow:g}=c[d];if(g+h.__rowSpan-1<=l){const p=c[d].cell.__headerState,m=gf(p,st.COLUMN);u.append(un(m).append(ve()))}else h.setRowSpan(h.__rowSpan+1)}const f=n.getChildAtIndex(l);tt(f)||fe(256),f.insertAfter(u),a=u}else{const l=s,c=r[l],u=Di();for(let d=0;d<i;d++){const{cell:h,startRow:g}=c[d];if(g===l){const p=c[d].cell.__headerState,m=gf(p,st.COLUMN);u.append(un(m).append(ve()))}else h.setRowSpan(h.__rowSpan+1)}const f=n.getChildAtIndex(l);tt(f)||fe(257),f.insertBefore(u),a=u}return a}function lP(e,t=!0,n=!0){const[,,r]=zn(e),[o,i]=an(r,e,e),s=o.length,{startColumn:a}=i,l=t?a+e.__colSpan-1:a-1,c=r.getFirstChild();tt(c)||fe(120);let u=null;function f(g=st.NO_STATUS){const p=un(g).append(ve());return u===null&&(u=p),p}let d=c;e:for(let g=0;g<s;g++){if(g!==0){const w=d.getNextSibling();tt(w)||fe(121),d=w}const p=o[g],m=p[l<0?0:l].cell.__headerState,v=gf(m,st.ROW);if(l<0){nC(d,f(v));continue}const{cell:y,startColumn:x,startRow:b}=p[l];if(x+y.__colSpan-1<=l){let w=y,_=b,E=l;for(;_!==g&&w.__rowSpan>1;){if(E-=y.__colSpan,!(E>=0)){d.append(f(v));continue e}{const{cell:R,startRow:k}=p[E];w=R,_=k}}w.insertAfter(f(v))}else y.setColSpan(y.__colSpan+1)}u!==null&&n&&cP(u);const h=r.getColWidths();if(h){const g=[...h],p=l<0?0:l,m=g[p];g.splice(p,0,m),r.setColWidths(g)}return u}function cP(e){const t=e.getFirstDescendant();t==null?e.selectStart():t.getParentOrThrow().selectStart()}function nC(e,t){const n=e.getFirstChild();n!==null?n.insertBefore(t):e.append(t)}function uP(e){if(e.length===0)return null;const t=sP(e[0]),[n]=Fr(t,null,null);let r=1/0,o=-1/0,i=1/0,s=-1/0;const a=new Set;for(const h of n)for(const g of h){if(!g||!g.cell)continue;const p=g.cell.getKey();if(!a.has(p)&&e.some(m=>m.is(g.cell))){a.add(p);const m=g.startRow,v=g.startColumn,y=g.cell.__rowSpan||1,x=g.cell.__colSpan||1;r=Math.min(r,m),o=Math.max(o,m+y-1),i=Math.min(i,v),s=Math.max(s,v+x-1)}}if(r===1/0||i===1/0)return null;const l=o-r+1,c=s-i+1,u=n[r][i];if(!u.cell)return null;const f=u.cell;f.setColSpan(c),f.setRowSpan(l);const d=new Set([f.getKey()]);for(let h=r;h<=o;h++)for(let g=i;g<=s;g++){const p=n[h][g];if(!p.cell)continue;const m=p.cell,v=m.getKey();d.has(v)||(d.add(v),dP(m)||f.append(...m.getChildren()),m.remove())}return f.getChildrenSize()===0&&f.append(ve()),f}function dP(e){if(e.getChildrenSize()!==1)return!1;const t=e.getFirstChildOrThrow();return!(!Qr(t)||!t.isEmpty())}function fP(e){const[t,n,r]=zn(e),o=t.__colSpan,i=t.__rowSpan;if(o===1&&i===1)return;const[s,a]=an(r,t,t),{startColumn:l,startRow:c}=a,u=t.__headerState&st.COLUMN,f=Array.from({length:o},(g,p)=>{let m=u;for(let v=0;m!==0&&v<s.length;v++)m&=s[v][p+l].cell.__headerState;return m}),d=t.__headerState&st.ROW,h=Array.from({length:i},(g,p)=>{let m=d;for(let v=0;m!==0&&v<s[0].length;v++)m&=s[p+c][v].cell.__headerState;return m});if(o>1){for(let g=1;g<o;g++)t.insertAfter(un(f[g]|h[0]).append(ve()));t.setColSpan(1)}if(i>1){let g;for(let p=1;p<i;p++){const m=c+p,v=s[m];g=(g||n).getNextSibling(),tt(g)||fe(125);let y=null;for(let x=0;x<l;x++){const b=v[x],w=b.cell;b.startRow===m&&(y=w),w.__colSpan>1&&(x+=w.__colSpan-1)}if(y===null)for(let x=o-1;x>=0;x--)nC(g,un(f[x]|h[p]).append(ve()));else for(let x=o-1;x>=0;x--)y.insertAfter(un(f[x]|h[p]).append(ve()))}t.setRowSpan(1)}}function an(e,t,n){const[r,o,i]=Fr(e,t,n);return o===null&&fe(207),i===null&&fe(208),[r,o,i]}function Fr(e,t,n){const r=[];let o=null,i=null;function s(l){let c=r[l];return c===void 0&&(r[l]=c=[]),c}const a=e.getChildren();for(let l=0;l<a.length;l++){const c=a[l];tt(c)||fe(209);const u=s(l);for(let f=c.getFirstChild(),d=0;f!=null;f=f.getNextSibling()){for(ge(f)||fe(147);u[d]!==void 0;)d++;const h={cell:f,startColumn:d,startRow:l},{__rowSpan:g,__colSpan:p}=f;for(let m=0;m<g&&!(l+m>=a.length);m++){const v=s(l+m);for(let y=0;y<p;y++)v[d+y]=h}t!==null&&o===null&&t.is(f)&&(o=h),n!==null&&i===null&&n.is(f)&&(i=h)}}return[r,o,i]}function zn(e){let t;if(e instanceof Mn)t=e;else if("__type"in e){const o=we(e,ge);ge(o)||fe(148),t=o}else{const o=we(e.getNode(),ge);ge(o)||fe(148),t=o}const n=t.getParent();tt(n)||fe(149);const r=n.getParent();return Ze(r)||fe(210),[t,n,r]}function jl(e,t,n){let r,o=Math.min(t.startColumn,n.startColumn),i=Math.min(t.startRow,n.startRow),s=Math.max(t.startColumn+t.cell.__colSpan-1,n.startColumn+n.cell.__colSpan-1),a=Math.max(t.startRow+t.cell.__rowSpan-1,n.startRow+n.cell.__rowSpan-1);do{r=!1;for(let l=0;l<e.length;l++)for(let c=0;c<e[0].length;c++){const u=e[l][c];if(!u)continue;const f=u.startColumn+u.cell.__colSpan-1,d=u.startRow+u.cell.__rowSpan-1,h=u.startColumn<=s&&f>=o,g=u.startRow<=a&&d>=i;if(h&&g){const p=Math.min(o,u.startColumn),m=Math.max(s,f),v=Math.min(i,u.startRow),y=Math.max(a,d);p===o&&m===s&&v===i&&y===a||(o=p,s=m,i=v,a=y,r=!0)}}}while(r);return{maxColumn:s,maxRow:a,minColumn:o,minRow:i}}function Jy(e){const[t,,n]=zn(e),r=n.getChildren(),o=r.length,i=r[0].getChildren().length,s=new Array(o);for(let a=0;a<o;a++)s[a]=new Array(i);for(let a=0;a<o;a++){const l=r[a].getChildren();let c=0;for(let u=0;u<l.length;u++){for(;s[a][c];)c++;const f=l[u],d=f.__rowSpan||1,h=f.__colSpan||1;for(let g=0;g<d;g++)for(let p=0;p<h;p++)s[a+g][c+p]=f;if(t===f)return{colSpan:h,columnIndex:c,rowIndex:a,rowSpan:d};c+=h}}return null}function Qy(e){const[[t,n,r,o],[i,s,a,l]]=["anchor","focus"].map(c=>{const u=e[c].getNode(),f=we(u,ge);ge(f)||fe(238,c,u.getKey(),u.getType());const d=f.getParent();tt(d)||fe(239,c);const h=d.getParent();return Ze(h)||fe(240,c),[u,f,d,h]});return o.is(l)||fe(241),{anchorCell:n,anchorNode:t,anchorRow:r,anchorTable:o,focusCell:s,focusNode:i,focusRow:a,focusTable:l}}class mc{tableKey;anchor;focus;_cachedNodes;dirty;constructor(t,n,r){this.anchor=n,this.focus=r,n._selection=this,r._selection=this,this._cachedNodes=null,this.dirty=!1,this.tableKey=t}getStartEndPoints(){return[this.anchor,this.focus]}isValid(){if(this.tableKey==="root"||this.anchor.key==="root"||this.anchor.type!=="element"||this.focus.key==="root"||this.focus.type!=="element")return!1;const t=Pe(this.tableKey),n=Pe(this.anchor.key),r=Pe(this.focus.key);return t!==null&&n!==null&&r!==null}isBackward(){return this.focus.isBefore(this.anchor)}getCachedNodes(){return this._cachedNodes}setCachedNodes(t){this._cachedNodes=t}is(t){return Ve(t)&&this.tableKey===t.tableKey&&this.anchor.is(t.anchor)&&this.focus.is(t.focus)}set(t,n,r){this.dirty=this.dirty||t!==this.tableKey||n!==this.anchor.key||r!==this.focus.key,this.tableKey=t,this.anchor.key=n,this.focus.key=r,this._cachedNodes=null}clone(){return new mc(this.tableKey,Kt(this.anchor.key,this.anchor.offset,this.anchor.type),Kt(this.focus.key,this.focus.offset,this.focus.type))}isCollapsed(){return!1}extract(){return this.getNodes()}insertRawText(t){}insertText(){}hasFormat(t){let n=0;this.getNodes().filter(ge).forEach(o=>{const i=o.getFirstChild();Qr(i)&&(n|=i.getTextFormat())});const r=Hr[t];return(n&r)!==0}insertNodes(t){const n=this.focus.getNode();B(n)||fe(151),Bs(n.select(0,n.getChildrenSize())).insertNodes(t)}getShape(){const{anchorCell:t,focusCell:n}=Qy(this),r=Jy(t);r===null&&fe(153);const o=Jy(n);o===null&&fe(155);const i=Math.min(r.columnIndex,o.columnIndex),s=Math.max(r.columnIndex+r.colSpan-1,o.columnIndex+o.colSpan-1),a=Math.min(r.rowIndex,o.rowIndex),l=Math.max(r.rowIndex+r.rowSpan-1,o.rowIndex+o.rowSpan-1);return{fromX:Math.min(i,s),fromY:Math.min(a,l),toX:Math.max(i,s),toY:Math.max(a,l)}}getNodes(){if(!this.isValid())return[];const t=this._cachedNodes;if(t!==null)return t;const{anchorTable:n,anchorCell:r,focusCell:o}=Qy(this),i=o.getParents()[1];if(i!==n){if(n.isParentOf(o)){const m=i.getParent();m==null&&fe(159),this.set(this.tableKey,o.getKey(),m.getKey())}else{const m=n.getParent();m==null&&fe(158),this.set(this.tableKey,m.getKey(),o.getKey())}return this.getNodes()}const[s,a,l]=an(n,r,o),{minColumn:c,maxColumn:u,minRow:f,maxRow:d}=jl(s,a,l),h=new Map([[n.getKey(),n]]);let g=null;for(let m=f;m<=d;m++)for(let v=c;v<=u;v++){const{cell:y}=s[m][v],x=y.getParent();tt(x)||fe(160),x!==g&&(h.set(x.getKey(),x),g=x),h.has(y.getKey())||gP(y,b=>{h.set(b.getKey(),b)})}const p=Array.from(h.values());return Yi()||(this._cachedNodes=p),p}getTextContent(){const t=this.getNodes().filter(r=>ge(r));let n="";for(let r=0;r<t.length;r++){const o=t[r],i=o.__parent,s=(t[r+1]||{}).__parent;n+=o.getTextContent()+(s!==i?`
64
+ `:" ")}return n}}function Ve(e){return e instanceof mc}function rC(){const e=Kt("root",0,"element"),t=Kt("root",0,"element");return new mc("root",e,t)}function hP(e,t,n){e.getKey(),t.getKey(),n.getKey();const r=X(),o=Ve(r)?r.clone():rC();return o.set(e.getKey(),t.getKey(),n.getKey()),o}function gP(e,t){const n=[[e]];for(let r=n.at(-1);r!==void 0&&n.length>0;r=n.at(-1)){const o=r.pop();o===void 0?n.pop():t(o)!==!1&&B(o)&&n.push(o.getChildren())}}function oC(e,t=Zi()){const n=Pe(e);Ze(n)||fe(231,e);const r=Do(n,t.getElementByKey(e));return r===null&&fe(232,e),{tableElement:r,tableNode:n}}class pP{focusX;focusY;listenersToRemove;table;isHighlightingCells;anchorX;anchorY;tableNodeKey;anchorCell;focusCell;anchorCellNodeKey;focusCellNodeKey;editor;tableSelection;hasHijackedSelectionStyles;isSelecting;pointerType;shouldCheckSelection;abortController;listenerOptions;nextFocus;constructor(t,n){this.isHighlightingCells=!1,this.anchorX=-1,this.anchorY=-1,this.focusX=-1,this.focusY=-1,this.listenersToRemove=new Set,this.tableNodeKey=n,this.editor=t,this.table={columns:0,domRows:[],rows:0},this.tableSelection=null,this.anchorCellNodeKey=null,this.focusCellNodeKey=null,this.anchorCell=null,this.focusCell=null,this.hasHijackedSelectionStyles=!1,this.isSelecting=!1,this.pointerType=null,this.shouldCheckSelection=!1,this.abortController=new AbortController,this.listenerOptions={signal:this.abortController.signal},this.nextFocus=null,this.trackTable()}getTable(){return this.table}removeListeners(){this.abortController.abort("removeListeners"),Array.from(this.listenersToRemove).forEach(t=>t()),this.listenersToRemove.clear()}$lookup(){return oC(this.tableNodeKey,this.editor)}trackTable(){const t=new MutationObserver(n=>{this.editor.getEditorState().read(()=>{let r=!1;for(let s=0;s<n.length;s++){const a=n[s].target.nodeName;if(a==="TABLE"||a==="TBODY"||a==="THEAD"||a==="TR"){r=!0;break}}if(!r)return;const{tableNode:o,tableElement:i}=this.$lookup();this.table=Ai(o,i)},{editor:this.editor})});this.editor.getEditorState().read(()=>{const{tableNode:n,tableElement:r}=this.$lookup();this.table=Ai(n,r),t.observe(r,{attributes:!0,childList:!0,subtree:!0})},{editor:this.editor})}$clearHighlight(){const t=this.editor;this.isHighlightingCells=!1,this.anchorX=-1,this.anchorY=-1,this.focusX=-1,this.focusY=-1,this.tableSelection=null,this.anchorCellNodeKey=null,this.focusCellNodeKey=null,this.anchorCell=null,this.focusCell=null,this.hasHijackedSelectionStyles=!1,this.$enableHighlightStyle();const{tableNode:n,tableElement:r}=this.$lookup();Va(t,Ai(n,r),null),X()!==null&&(Ge(null),t.dispatchCommand(fr,void 0))}$enableHighlightStyle(){const t=this.editor,{tableElement:n}=this.$lookup();Yn(n,t._config.theme.tableSelection),n.classList.remove("disable-selection"),this.hasHijackedSelectionStyles=!1}$disableHighlightStyle(){const{tableElement:t}=this.$lookup();et(t,this.editor._config.theme.tableSelection),this.hasHijackedSelectionStyles=!0}$updateTableTableSelection(t){if(t!==null){t.tableKey!==this.tableNodeKey&&fe(233,t.tableKey,this.tableNodeKey);const n=this.editor;this.tableSelection=t,this.isHighlightingCells=!0,this.$disableHighlightStyle(),this.updateDOMSelection(),Va(n,this.table,this.tableSelection)}else this.$clearHighlight()}setShouldCheckSelection(){this.shouldCheckSelection=!0}getAndClearShouldCheckSelection(){return!!this.shouldCheckSelection&&(this.shouldCheckSelection=!1,!0)}setNextFocus(t){this.nextFocus=t}getAndClearNextFocus(){const{nextFocus:t}=this;return t!==null&&(this.nextFocus=null),t}updateDOMSelection(){if(this.anchorCell!==null&&this.focusCell!==null){const t=Ot(this.editor._window);t&&t.rangeCount>0&&t.removeAllRanges()}}$setFocusCellForSelection(t,n=!1){const r=this.editor,{tableNode:o}=this.$lookup(),i=t.x,s=t.y;if(this.focusCell=t,this.isHighlightingCells||this.anchorX===i&&this.anchorY===s&&!n){if(i===this.focusX&&s===this.focusY)return!1}else this.isHighlightingCells=!0,this.$disableHighlightStyle();if(this.focusX=i,this.focusY=s,this.isHighlightingCells){const a=mf(o,t.elem);if(this.tableSelection!=null&&this.anchorCellNodeKey!=null&&a!==null)return this.focusCellNodeKey=a.getKey(),this.tableSelection=hP(o,this.$getAnchorTableCellOrThrow(),a),Ge(this.tableSelection),r.dispatchCommand(fr,void 0),Va(r,this.table,this.tableSelection),!0}return!1}$getAnchorTableCell(){return this.anchorCellNodeKey?Pe(this.anchorCellNodeKey):null}$getAnchorTableCellOrThrow(){const t=this.$getAnchorTableCell();return t===null&&fe(234),t}$getFocusTableCell(){return this.focusCellNodeKey?Pe(this.focusCellNodeKey):null}$getFocusTableCellOrThrow(){const t=this.$getFocusTableCell();return t===null&&fe(235),t}$setAnchorCellForSelection(t){this.isHighlightingCells=!1,this.anchorCell=t,this.anchorX=t.x,this.anchorY=t.y;const{tableNode:n}=this.$lookup(),r=mf(n,t.elem);if(r!==null){const o=r.getKey();this.tableSelection=this.tableSelection!=null?this.tableSelection.clone():rC(),this.anchorCellNodeKey=o}}$formatCells(t){const n=X();Ve(n)||fe(236);const r=ic(),o=r.anchor,i=r.focus,s=n.getNodes().filter(ge);s.length>0||fe(237);const a=s[0].getFirstChild(),l=Qr(a)?a.getFormatFlags(t,null):null;s.forEach(c=>{o.set(c.getKey(),0,"element"),i.set(c.getKey(),c.getChildrenSize(),"element"),r.formatText(t,l)}),Ge(n),this.editor.dispatchCommand(fr,void 0)}$clearText(){const{editor:t}=this,n=Pe(this.tableNodeKey);if(!Ze(n))throw new Error("Expected TableNode.");const r=X();Ve(r)||fe(253);const o=r.getNodes().filter(ge),i=n.getFirstChild(),s=n.getLastChild();if(o.length>0&&i!==null&&s!==null&&tt(i)&&tt(s)&&o[0]===i.getFirstChild()&&o[o.length-1]===s.getLastChild()){n.selectPrevious();const a=n.getParent();return n.remove(),void(at(a)&&a.isEmpty()&&t.dispatchCommand(Mo,void 0))}o.forEach(a=>{if(B(a)){const l=ve(),c=Fe();l.append(c),a.append(l),a.getChildren().forEach(u=>{u!==l&&u.remove()})}}),Va(t,this.table,null),Ge(null),t.dispatchCommand(fr,void 0)}}const pf="__lexicalTableSelection";function fi(e){return Be(e)&&e.nodeName==="TABLE"}function Do(e,t){if(!t)return t;const n=fi(t)?t:e.getDOMSlot(t).element;return n.nodeName!=="TABLE"&&fe(245,t.nodeName),n}function og(e){return e._window}function Ps(e,t){for(let n=t,r=null;n!==null;n=n.getParent()){if(e.is(n))return r;ge(n)&&(r=n)}return null}const mP=[[wh,"down"],[bh,"up"],[xh,"backward"],[vh,"forward"]],yP=[$i,Po,Ir],vP=[ec,Sh];function xP(e,t,n,r){const o=n.getRootElement(),i=og(n);o!==null&&i!==null||fe(246);const s=new pP(n,e.getKey()),a=Do(e,t);(function(h,g){ev(h)!==null&&fe(205),h[pf]=g})(a,s),s.listenersToRemove.add(()=>(function(h,g){ev(h)===g&&delete h[pf]})(a,s));const l=h=>{if(s.pointerType=h.pointerType,h.button!==0||!Cn(h.target)||!i)return;const g=Vl(h.target);g!==null&&n.update(()=>{const p=Zn();if(Zy&&h.shiftKey&&In(p,e)&&(W(p)||Ve(p))){const m=p.anchor.getNode(),v=Ps(e,p.anchor.getNode());v?(s.$setAnchorCellForSelection(vo(s,v)),s.$setFocusCellForSelection(g),dr(h)):(e.isBefore(m)?e.selectStart():e.selectEnd()).anchor.set(p.anchor.key,p.anchor.offset,p.anchor.type)}else h.pointerType!=="touch"&&s.$setAnchorCellForSelection(g)}),(()=>{if(s.isSelecting)return;const p=()=>{s.isSelecting=!1,i.removeEventListener("pointerup",p),i.removeEventListener("pointermove",m)},m=v=>{if(1&~v.buttons&&s.isSelecting)return s.isSelecting=!1,i.removeEventListener("pointerup",p),void i.removeEventListener("pointermove",m);if(!Cn(v.target))return;let y=null;const x=!(Zy||a.contains(v.target));if(x)y=tv(a,v.target);else for(const b of document.elementsFromPoint(v.clientX,v.clientY))if(y=tv(a,b),y)break;!y||s.focusCell!==null&&y.elem===s.focusCell.elem||(s.setNextFocus({focusCell:y,override:x}),n.dispatchCommand(fr,void 0))};s.isSelecting=!0,i.addEventListener("pointerup",p,s.listenerOptions),i.addEventListener("pointermove",m,s.listenerOptions)})()};a.addEventListener("pointerdown",l,s.listenerOptions),s.listenersToRemove.add(()=>{a.removeEventListener("pointerdown",l)});const c=h=>{h.detail>=3&&Cn(h.target)&&Vl(h.target)!==null&&h.preventDefault()};a.addEventListener("mousedown",c,s.listenerOptions),s.listenersToRemove.add(()=>{a.removeEventListener("mousedown",c)});const u=h=>{const g=h.target;h.button===0&&Cn(g)&&n.update(()=>{const p=X();Ve(p)&&p.tableKey===s.tableNodeKey&&o.contains(g)&&s.$clearHighlight()})};i.addEventListener("pointerdown",u,s.listenerOptions),s.listenersToRemove.add(()=>{i.removeEventListener("pointerdown",u)});for(const[h,g]of mP)s.listenersToRemove.add(n.registerCommand(h,p=>aC(n,p,g,e,s),Dt));s.listenersToRemove.add(n.registerCommand(Ch,h=>{const g=X();if(Ve(g)){const p=Ps(e,g.focus.getNode());if(p!==null)return dr(h),p.selectEnd(),!0}return!1},Dt));const f=h=>()=>{const g=X();if(!In(g,e))return!1;if(Ve(g))return s.$clearText(),!0;if(W(g)){if(!ge(Ps(e,g.anchor.getNode())))return!1;const p=g.anchor.getNode(),m=g.focus.getNode(),v=e.isParentOf(p),y=e.isParentOf(m);if(v&&!y||y&&!v)return s.$clearText(),!0;const x=we(g.anchor.getNode(),w=>B(w)),b=x&&we(x,w=>B(w)&&ge(w.getParent()));if(!B(b)||!B(x))return!1;if(h===Po&&b.getPreviousSibling()===null)return!0}return!1};for(const h of yP)s.listenersToRemove.add(n.registerCommand(h,f(h),Dt));const d=h=>{const g=X();if(!Ve(g)&&!W(g))return!1;const p=e.isParentOf(g.anchor.getNode());if(p!==e.isParentOf(g.focus.getNode())){const m=p?"anchor":"focus",v=p?"focus":"anchor",{key:y,offset:x,type:b}=g[v];return e[g[m].isBefore(g[v])?"selectPrevious":"selectNext"]()[v].set(y,x,b),!1}return!!In(g,e)&&!!Ve(g)&&(h&&(h.preventDefault(),h.stopPropagation()),s.$clearText(),!0)};for(const h of vP)s.listenersToRemove.add(n.registerCommand(h,d,Dt));return s.listenersToRemove.add(n.registerCommand(nc,h=>{const g=X();if(g){if(!Ve(g)&&!W(g))return!1;af(n,Pr(h,ClipboardEvent)?h:null,Aw(g));const p=d(h);return W(g)?(g.removeText(),!0):p}return!1},Dt)),s.listenersToRemove.add(n.registerCommand(Vt,h=>{const g=X();if(!In(g,e))return!1;if(Ve(g))return s.$formatCells(h),!0;if(W(g)){const p=we(g.anchor.getNode(),m=>ge(m));if(!ge(p))return!1}return!1},Dt)),s.listenersToRemove.add(n.registerCommand(_i,h=>{const g=X();if(!Ve(g)||!In(g,e))return!1;const p=g.anchor.getNode(),m=g.focus.getNode();if(!ge(p)||!ge(m))return!1;if((function(k,M){if(Ve(k)){const F=k.anchor.getNode(),D=k.focus.getNode();if(M&&F&&D){const[j]=an(M,F,D);return F.getKey()===j[0][0].cell.getKey()&&D.getKey()===j[j.length-1].at(-1).cell.getKey()}}return!1})(g,e))return e.setFormat(h),!0;const[v,y,x]=an(e,p,m),b=Math.max(y.startRow+y.cell.__rowSpan-1,x.startRow+x.cell.__rowSpan-1),w=Math.max(y.startColumn+y.cell.__colSpan-1,x.startColumn+x.cell.__colSpan-1),_=Math.min(y.startRow,x.startRow),E=Math.min(y.startColumn,x.startColumn),R=new Set;for(let k=_;k<=b;k++)for(let M=E;M<=w;M++){const F=v[k][M].cell;if(R.has(F))continue;R.add(F),F.setFormat(h);const D=F.getChildren();for(let j=0;j<D.length;j++){const I=D[j];B(I)&&!I.isInline()&&I.setFormat(h)}}return!0},Dt)),s.listenersToRemove.add(n.registerCommand(To,h=>{const g=X();if(!In(g,e))return!1;if(Ve(g))return s.$clearHighlight(),!1;if(W(g)){const p=we(g.anchor.getNode(),m=>ge(m));if(!ge(p))return!1;if(typeof h=="string"){const m=ov(n,g,e);if(m)return rv(m,e,[Fe(h)]),!0}}return!1},Dt)),r&&s.listenersToRemove.add(n.registerCommand(_h,h=>{const g=X();if(!W(g)||!g.isCollapsed()||!In(g,e))return!1;const p=fs(g.anchor.getNode());return!(p===null||!e.is(Ni(p)))&&(dr(h),(function(m,v){const y=v==="next"?"getNextSibling":"getPreviousSibling",x=v==="next"?"getFirstChild":"getLastChild",b=m[y]();if(B(b))return b.selectEnd();const w=we(m,tt);w===null&&fe(247);for(let E=w[y]();tt(E);E=E[y]()){const R=E[x]();if(B(R))return R.selectEnd()}const _=we(w,Ze);_===null&&fe(248),v==="next"?_.selectNext():_.selectPrevious()})(p,h.shiftKey?"previous":"next"),!0)},Dt)),s.listenersToRemove.add(n.registerCommand(r1,h=>e.isSelected(),Dt)),s.listenersToRemove.add(n.registerCommand(mh,(h,g)=>{if(n!==g)return!1;const{nodes:p,selection:m}=h,v=m.getStartEndPoints(),y=Ve(m),x=W(m)&&we(m.anchor.getNode(),ee=>ge(ee))!==null&&we(m.focus.getNode(),ee=>ge(ee))!==null||y;if(p.length!==1||!Ze(p[0])||!x||v===null)return!1;const[b,w]=v,[_,E,R]=zn(b),k=we(w.getNode(),ee=>ge(ee));if(!(ge(_)&&ge(k)&&tt(E)&&Ze(R)))return!1;const M=p[0],[F,D,j]=an(R,_,k),[I]=Fr(M,null,null),$=F.length,H=$>0?F[0].length:0;let O=D.startRow,P=D.startColumn,K=I.length,G=K>0?I[0].length:0;if(y){const ee=jl(F,D,j),xe=ee.maxRow-ee.minRow+1,Se=ee.maxColumn-ee.minColumn+1;O=ee.minRow,P=ee.minColumn,K=Math.min(K,xe),G=Math.min(G,Se)}let re=!1;const U=Math.min($,O+K)-1,Z=Math.min(H,P+G)-1,Q=new Set;for(let ee=O;ee<=U;ee++)for(let xe=P;xe<=Z;xe++){const Se=F[ee][xe];Q.has(Se.cell.getKey())||Se.cell.__rowSpan===1&&Se.cell.__colSpan===1||(fP(Se.cell),Q.add(Se.cell.getKey()),re=!0)}let[ne]=Fr(R.getWritable(),null,null);const oe=K-$+O;for(let ee=0;ee<oe;ee++)aP(ne[$-1][0].cell);const me=G-H+P;for(let ee=0;ee<me;ee++)lP(ne[0][H-1].cell,!0,!1);[ne]=Fr(R.getWritable(),null,null);for(let ee=O;ee<O+K;ee++)for(let xe=P;xe<P+G;xe++){const Se=ee-O,Ee=xe-P,ze=I[Se][Ee];if(ze.startRow!==Se||ze.startColumn!==Ee)continue;const je=ze.cell;if(je.__rowSpan!==1||je.__colSpan!==1){const ot=[],Gt=Math.min(ee+je.__rowSpan,O+K)-1,Qt=Math.min(xe+je.__colSpan,P+G)-1;for(let pt=ee;pt<=Gt;pt++)for(let se=xe;se<=Qt;se++){const Re=ne[pt][se];ot.push(Re.cell)}uP(ot),re=!0}const{cell:Rt}=ne[ee][xe],gn=Rt.getChildren();je.getChildren().forEach(ot=>{J(ot)&&ve().append(ot),Rt.append(ot)}),gn.forEach(ot=>ot.remove())}if(y&&re){const[ee]=Fr(R.getWritable(),null,null);ee[D.startRow][D.startColumn].cell.selectEnd()}return!0},Dt)),s.listenersToRemove.add(n.registerCommand(fr,()=>{const h=X(),g=Zn(),p=s.getAndClearNextFocus();if(p!==null){const{focusCell:m}=p;if(Ve(h)&&h.tableKey===s.tableNodeKey)return(m.x!==s.focusX||m.y!==s.focusY)&&(s.$setFocusCellForSelection(m),!0);if(m!==s.anchorCell&&In(h,e))return s.$setFocusCellForSelection(m),!0}if(s.getAndClearShouldCheckSelection()&&W(g)&&W(h)&&h.isCollapsed()){const m=h.anchor.getNode(),v=e.getFirstChild(),y=fs(m);if(y!==null&&tt(v)){const x=v.getFirstChild();if(ge(x)&&e.is(we(y,b=>b.is(e)||b.is(x))))return x.selectStart(),!0}}if(W(h)){const{anchor:m,focus:v}=h,y=m.getNode(),x=v.getNode(),b=fs(y),w=fs(x),_=!(!b||!e.is(Ni(b))),E=!(!w||!e.is(Ni(w))),R=_!==E,k=_&&E,M=h.isBackward();if(R){const F=h.clone();if(E){const[D]=an(e,w,w),j=D[0][0].cell,I=D[D.length-1].at(-1).cell;F.focus.set(M?j.getKey():I.getKey(),M?0:I.getChildrenSize(),"element")}else if(_){const[D]=an(e,b,b),j=D[0][0].cell,I=D[D.length-1].at(-1).cell;F.anchor.set(M?I.getKey():j.getKey(),M?I.getChildrenSize():0,"element")}Ge(F),nv(n,s)}else if(k&&(b.is(w)||(s.$setAnchorCellForSelection(vo(s,b)),s.$setFocusCellForSelection(vo(s,w),!0)),s.pointerType==="touch"&&s.isSelecting&&h.isCollapsed()&&W(g)&&g.isCollapsed())){const F=fs(g.anchor.getNode());F&&!F.is(w)&&(s.$setAnchorCellForSelection(vo(s,F)),s.$setFocusCellForSelection(vo(s,w),!0),s.pointerType=null)}}else if(h&&Ve(h)&&h.is(g)&&h.tableKey===e.getKey()){const m=Ot(i);if(m&&m.anchorNode&&m.focusNode){const v=Ut(m.focusNode),y=v&&!e.isParentOf(v),x=Ut(m.anchorNode),b=x&&e.isParentOf(x);if(y&&b&&m.rangeCount>0){const w=uA(m,n);w&&(w.anchor.set(e.getKey(),h.isBackward()?e.getChildrenSize():0,"element"),m.removeAllRanges(),Ge(w))}}}return h&&!h.is(g)&&(Ve(h)||Ve(g))&&s.tableSelection&&!s.tableSelection.is(g)?(Ve(h)&&h.tableKey===s.tableNodeKey?s.$updateTableTableSelection(h):!Ve(h)&&Ve(g)&&g.tableKey===s.tableNodeKey&&s.$updateTableTableSelection(null),!1):(s.hasHijackedSelectionStyles&&!e.isSelected()?(function(m,v){v.$enableHighlightStyle(),ig(v.table,y=>{const x=y.elem;y.highlighted=!1,sC(m,y),x.getAttribute("style")||x.removeAttribute("style")})})(n,s):!s.hasHijackedSelectionStyles&&e.isSelected()&&nv(n,s),!1)},Dt)),s.listenersToRemove.add(n.registerCommand(Mo,()=>{const h=X();if(!W(h)||!h.isCollapsed()||!In(h,e))return!1;const g=ov(n,h,e);return!!g&&(rv(g,e),!0)},Dt)),s}function ev(e){return e[pf]||null}function Vl(e){let t=e;for(;t!=null;){const n=t.nodeName;if(n==="TD"||n==="TH"){const r=t._cell;return r===void 0?null:r}t=t.parentNode}return null}function tv(e,t){if(!e.contains(t))return null;let n=null;for(let r=t;r!=null;r=r.parentNode){if(r===e)return n;const o=r.nodeName;o!=="TD"&&o!=="TH"||(n=r._cell||null)}return null}function Ai(e,t){const n=[],r={columns:0,domRows:n,rows:0};let o=Do(e,t).querySelector("tr"),i=0,s=0;for(n.length=0;o!=null;){const a=o.nodeName;if(a==="TD"||a==="TH"){const u={elem:o,hasBackgroundColor:o.style.backgroundColor!=="",highlighted:!1,x:i,y:s};o._cell=u;let f=n[s];f===void 0&&(f=n[s]=[]),f[i]=u}else{const u=o.firstChild;if(u!=null){o=u;continue}}const l=o.nextSibling;if(l!=null){i++,o=l;continue}const c=o.parentNode;if(c!=null){const u=c.nextSibling;if(u==null)break;s++,i=0,o=u}}return r.columns=i+1,r.rows=s+1,r}function Va(e,t,n){const r=new Set(n?n.getNodes():[]);ig(t,(o,i)=>{const s=o.elem;r.has(i)?(o.highlighted=!0,iC(e,o)):(o.highlighted=!1,sC(e,o),s.getAttribute("style")||s.removeAttribute("style"))})}function ig(e,t){const{domRows:n}=e;for(let r=0;r<n.length;r++){const o=n[r];if(o)for(let i=0;i<o.length;i++){const s=o[i];if(!s)continue;const a=Ut(s.elem);a!==null&&t(s,a,{x:i,y:r})}}}function nv(e,t){t.$disableHighlightStyle(),ig(t.table,n=>{n.highlighted=!0,iC(e,n)})}const bP=(e,t,n,r,o)=>{const i=o==="forward";switch(o){case"backward":case"forward":return n!==(i?e.table.columns-1:0)?za(t.getCellNodeFromCordsOrThrow(n+(i?1:-1),r,e.table),i):r!==(i?e.table.rows-1:0)?za(t.getCellNodeFromCordsOrThrow(i?0:e.table.columns-1,r+(i?1:-1),e.table),i):i?t.selectNext():t.selectPrevious(),!0;case"up":return r!==0?za(t.getCellNodeFromCordsOrThrow(n,r-1,e.table),!1):t.selectPrevious(),!0;case"down":return r!==e.table.rows-1?za(t.getCellNodeFromCordsOrThrow(n,r+1,e.table),!0):t.selectNext(),!0;default:return!1}};function vu(e,t){let n,r;if(t.startColumn===e.minColumn)n="minColumn";else{if(t.startColumn+t.cell.__colSpan-1!==e.maxColumn)return null;n="maxColumn"}if(t.startRow===e.minRow)r="minRow";else{if(t.startRow+t.cell.__rowSpan-1!==e.maxRow)return null;r="maxRow"}return[n,r]}function Ba([e,t]){return[e==="minColumn"?"maxColumn":"minColumn",t==="minRow"?"maxRow":"minRow"]}function ni(e,t,[n,r]){const o=t[r],i=e[o];i===void 0&&fe(250,r,String(o));const s=t[n],a=i[s];return a===void 0&&fe(250,n,String(s)),a}function wP(e,t,n,r,o){const i=jl(t,n,r),s=(function(_,E){const{minColumn:R,maxColumn:k,minRow:M,maxRow:F}=E;let D=1,j=1,I=1,$=1;const H=_[M],O=_[F];for(let P=R;P<=k;P++)D=Math.max(D,H[P].cell.__rowSpan),$=Math.max($,O[P].cell.__rowSpan);for(let P=M;P<=F;P++)j=Math.max(j,_[P][R].cell.__colSpan),I=Math.max(I,_[P][k].cell.__colSpan);return{bottomSpan:$,leftSpan:j,rightSpan:I,topSpan:D}})(t,i),{topSpan:a,leftSpan:l,bottomSpan:c,rightSpan:u}=s,f=(function(_,E){const R=vu(_,E);return R===null&&fe(249,E.cell.getKey()),R})(i,n),[d,h]=Ba(f);let g=i[d],p=i[h];o==="forward"?g+=d==="maxColumn"?1:l:o==="backward"?g-=d==="minColumn"?1:u:o==="down"?p+=h==="maxRow"?1:a:o==="up"&&(p-=h==="minRow"?1:c);const m=t[p];if(m===void 0)return!1;const v=m[g];if(v===void 0)return!1;const[y,x]=(function(_,E,R){const k=jl(_,E,R),M=vu(k,E);if(M)return[ni(_,k,M),ni(_,k,Ba(M))];const F=vu(k,R);if(F)return[ni(_,k,Ba(F)),ni(_,k,F)];const D=["minColumn","minRow"];return[ni(_,k,D),ni(_,k,Ba(D))]})(t,n,v),b=vo(e,y.cell),w=vo(e,x.cell);return e.$setAnchorCellForSelection(b),e.$setFocusCellForSelection(w,!0),!0}function In(e,t){if(W(e)||Ve(e)){const n=t.isParentOf(e.anchor.getNode()),r=t.isParentOf(e.focus.getNode());return n&&r}return!1}function za(e,t){t?e.selectStart():e.selectEnd()}function iC(e,t){const n=t.elem,r=e._config.theme;ge(Ut(n))||fe(131),et(n,r.tableCellSelected)}function sC(e,t){const n=t.elem;ge(Ut(n))||fe(131);const r=e._config.theme;Yn(n,r.tableCellSelected)}function fs(e){const t=we(e,ge);return ge(t)?t:null}function Ni(e){const t=we(e,Ze);return Ze(t)?t:null}function CP(e,t,n,r,o,i,s){const a=An(n.focus,o?"previous":"next");if(Kh(a))return!1;let l=a;for(const m of Us(a).iterNodeCarets("shadowRoot")){if(!Wr(m)||!B(m.origin))return!1;l=m}const c=l.getParentAtCaret();if(!ge(c))return!1;const u=c,f=(function(m){for(const v of Us(m).iterNodeCarets("root")){const{origin:y}=v;if(ge(y)){if(zt(v))return Ft(y,m.direction)}else if(!tt(y))break}return null})(nt(u,l.direction)),d=we(u,Ze);if(!d||!d.is(i))return!1;const h=e.getElementByKey(u.getKey()),g=Vl(h);if(!h||!g)return!1;const p=_P(e,d);if(s.table=p,f)if(r==="extend"){const m=Vl(e.getElementByKey(f.origin.getKey()));if(!m)return!1;s.$setAnchorCellForSelection(g),s.$setFocusCellForSelection(m,!0)}else{const m=Lt(f);Sn(n.anchor,m),Sn(n.focus,m)}else if(r==="extend")s.$setAnchorCellForSelection(g),s.$setFocusCellForSelection(g,!0);else{const m=(function(v){const y=ca(v);return zt(y)?Lt(y):v})(nt(d,a.direction));Sn(n.anchor,m),Sn(n.focus,m)}return dr(t),!0}function aC(e,t,n,r,o){if((n==="up"||n==="down")&&(function(s){const a=s.getRootElement();return a?a.hasAttribute("aria-controls")&&a.getAttribute("aria-controls")==="typeahead-menu":!1})(e))return!1;const i=X();if(!In(i,r)){if(W(i)){if(n==="backward"){if(i.focus.offset>0)return!1;const s=(function(l){for(let c=l,u=l;u!==null;c=u,u=u.getParent())if(B(u)){if(u!==c&&u.getFirstChild()!==c)return null;if(!u.isInline())return u}return null})(i.focus.getNode());if(!s)return!1;const a=s.getPreviousSibling();return!!Ze(a)&&(dr(t),t.shiftKey?i.focus.set(a.getParentOrThrow().getKey(),a.getIndexWithinParent(),"element"):a.selectEnd(),!0)}if(t.shiftKey&&(n==="up"||n==="down")){const s=i.focus.getNode();if(!i.isCollapsed()&&(n==="up"&&!i.isBackward()||n==="down"&&i.isBackward())){let a=we(s,d=>Ze(d));if(ge(a)&&(a=we(a,Ze)),a!==r||!a)return!1;const l=n==="down"?a.getNextSibling():a.getPreviousSibling();if(!l)return!1;let c=0;n==="up"&&B(l)&&(c=l.getChildrenSize());let u=l;n==="up"&&B(l)&&(u=l.getLastChild()||l,c=J(u)?u.getTextContentSize():0);const f=i.clone();return f.focus.set(u.getKey(),c,J(u)?"text":"element"),Ge(f),dr(t),!0}if(vt(s)){const a=n==="up"?i.getNodes()[i.getNodes().length-1]:i.getNodes()[0];if(a&&Ps(r,a)!==null){const l=r.getFirstDescendant(),c=r.getLastDescendant();if(!l||!c)return!1;const[u]=zn(l),[f]=zn(c),d=r.getCordsFromCellNode(u,o.table),h=r.getCordsFromCellNode(f,o.table),g=r.getDOMCellFromCordsOrThrow(d.x,d.y,o.table),p=r.getDOMCellFromCordsOrThrow(h.x,h.y,o.table);return o.$setAnchorCellForSelection(g),o.$setFocusCellForSelection(p,!0),!0}return!1}{let a=we(s,c=>B(c)&&!c.isInline());if(ge(a)&&(a=we(a,Ze)),!a)return!1;const l=n==="down"?a.getNextSibling():a.getPreviousSibling();if(Ze(l)&&o.tableNodeKey===l.getKey()){const c=l.getFirstDescendant(),u=l.getLastDescendant();if(!c||!u)return!1;const[f]=zn(c),[d]=zn(u),h=i.clone();return h.focus.set((n==="up"?f:d).getKey(),n==="up"?0:d.getChildrenSize(),"element"),dr(t),Ge(h),!0}}}}return n==="down"&&Bl(e)&&o.setShouldCheckSelection(),!1}if(W(i)){if(n==="backward"||n==="forward")return CP(e,t,i,t.shiftKey?"extend":"move",n==="backward",r,o);if(i.isCollapsed()){const{anchor:s,focus:a}=i,l=we(s.getNode(),ge),c=we(a.getNode(),ge);if(!ge(l)||!l.is(c))return!1;const u=Ni(l);if(u!==r&&u!=null){const v=Do(u,e.getElementByKey(u.getKey()));if(v!=null)return o.table=Ai(u,v),aC(e,t,n,u,o)}const f=e.getElementByKey(l.__key),d=e.getElementByKey(s.key);if(d==null||f==null)return!1;let h;if(s.type==="element")h=d.getBoundingClientRect();else{const v=Ot(og(e));if(v===null||v.rangeCount===0)return!1;h=v.getRangeAt(0).getBoundingClientRect()}const g=n==="up"?l.getFirstChild():l.getLastChild();if(g==null)return!1;const p=e.getElementByKey(g.__key);if(p==null)return!1;const m=p.getBoundingClientRect();if(n==="up"?m.top>h.top-h.height:h.bottom+h.height>m.bottom){dr(t);const v=r.getCordsFromCellNode(l,o.table);if(!t.shiftKey)return bP(o,r,v.x,v.y,n);{const y=r.getDOMCellFromCordsOrThrow(v.x,v.y,o.table);o.$setAnchorCellForSelection(y),o.$setFocusCellForSelection(y,!0)}return!0}}}else if(Ve(i)){const{anchor:s,focus:a}=i,l=we(s.getNode(),ge),c=we(a.getNode(),ge),[u]=i.getNodes();Ze(u)||fe(251);const f=Do(u,e.getElementByKey(u.getKey()));if(!ge(l)||!ge(c)||!Ze(u)||f==null)return!1;o.$updateTableTableSelection(i);const d=Ai(u,f),h=r.getCordsFromCellNode(l,d),g=r.getDOMCellFromCordsOrThrow(h.x,h.y,d);if(o.$setAnchorCellForSelection(g),dr(t),t.shiftKey){const[p,m,v]=an(r,l,c);return wP(o,p,m,v,n)}return c.selectEnd(),!0}return!1}function dr(e){e.preventDefault(),e.stopImmediatePropagation(),e.stopPropagation()}function rv(e,t,n){const r=ve();e==="first"?t.insertBefore(r):t.insertAfter(r),r.append(...n||[]),r.selectEnd()}function ov(e,t,n){const r=n.getParent();if(!r)return;const o=Ot(og(e));if(!o)return;const i=o.anchorNode,s=e.getElementByKey(r.getKey()),a=Do(n,e.getElementByKey(n.getKey()));if(!i||!s||!a||!s.contains(i)||a.contains(i))return;const l=we(t.anchor.getNode(),y=>ge(y));if(!l)return;const c=we(l,y=>Ze(y));if(!Ze(c)||!c.is(n))return;const[u,f]=an(n,l,l),d=u[0][0],h=u[u.length-1][u[0].length-1],{startRow:g,startColumn:p}=f,m=g===d.startRow&&p===d.startColumn,v=g===h.startRow&&p===h.startColumn;return m?"first":v?"last":void 0}function vo(e,t){const{tableNode:n}=e.$lookup(),r=n.getCordsFromCellNode(t,e.table);return n.getDOMCellFromCordsOrThrow(r.x,r.y,e.table)}function mf(e,t,n){return Ps(e,Ut(t,n))}function iv(e,t,n){if(!t.theme.tableAlignment)return;const r=[],o=[];for(const i of["center","right"]){const s=t.theme.tableAlignment[i];s&&(i===n?o:r).push(s)}Yn(e,...r),et(e,...o)}const yf=new WeakSet;function Bl(e=Zi()){return yf.has(e)}function SP(e,t){t?yf.add(e):yf.delete(e)}class Pn extends Tt{__rowStriping;__frozenColumnCount;__frozenRowCount;__colWidths;static getType(){return"table"}getColWidths(){return this.getLatest().__colWidths}setColWidths(t){const n=this.getWritable();return n.__colWidths=t,n}static clone(t){return new Pn(t.__key)}afterCloneFrom(t){super.afterCloneFrom(t),this.__colWidths=t.__colWidths,this.__rowStriping=t.__rowStriping,this.__frozenColumnCount=t.__frozenColumnCount,this.__frozenRowCount=t.__frozenRowCount}static importDOM(){return{table:t=>({conversion:TP,priority:1})}}static importJSON(t){return yc().updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setRowStriping(t.rowStriping||!1).setFrozenColumns(t.frozenColumnCount||0).setFrozenRows(t.frozenRowCount||0).setColWidths(t.colWidths)}constructor(t){super(t),this.__rowStriping=!1,this.__frozenColumnCount=0,this.__frozenRowCount=0,this.__colWidths=void 0}exportJSON(){return{...super.exportJSON(),colWidths:this.getColWidths(),frozenColumnCount:this.__frozenColumnCount?this.__frozenColumnCount:void 0,frozenRowCount:this.__frozenRowCount?this.__frozenRowCount:void 0,rowStriping:this.__rowStriping?this.__rowStriping:void 0}}extractWithChild(t,n,r){return r==="html"}getDOMSlot(t){const n=fi(t)?t:t.querySelector("table");return fi(n)||fe(229),super.getDOMSlot(t).withElement(n).withAfter(n.querySelector("colgroup"))}createDOM(t,n){const r=document.createElement("table");this.__style&&(r.style.cssText=this.__style);const o=document.createElement("colgroup");if(r.appendChild(o),PA(o),et(r,t.theme.table),this.updateTableElement(null,r,t),Bl(n)){const i=document.createElement("div"),s=t.theme.tableScrollableWrapper;return s?et(i,s):i.style.cssText="overflow-x: auto;",i.appendChild(r),this.updateTableWrapper(null,i,r,t),i}return r}updateTableWrapper(t,n,r,o){this.__frozenColumnCount!==(t?t.__frozenColumnCount:0)&&(function(i,s,a,l){l>0?(et(i,a.theme.tableFrozenColumn),s.setAttribute("data-lexical-frozen-column","true")):(Yn(i,a.theme.tableFrozenColumn),s.removeAttribute("data-lexical-frozen-column"))})(n,r,o,this.__frozenColumnCount),this.__frozenRowCount!==(t?t.__frozenRowCount:0)&&(function(i,s,a,l){l>0?(et(i,a.theme.tableFrozenRow),s.setAttribute("data-lexical-frozen-row","true")):(Yn(i,a.theme.tableFrozenRow),s.removeAttribute("data-lexical-frozen-row"))})(n,r,o,this.__frozenRowCount)}updateTableElement(t,n,r){this.__style!==(t?t.__style:"")&&(n.style.cssText=this.__style),this.__rowStriping!==(!!t&&t.__rowStriping)&&(function(o,i,s){s?(et(o,i.theme.tableRowStriping),o.setAttribute("data-lexical-row-striping","true")):(Yn(o,i.theme.tableRowStriping),o.removeAttribute("data-lexical-row-striping"))})(n,r,this.__rowStriping),(function(o,i,s,a){const l=o.querySelector("colgroup");if(!l)return;const c=[];for(let u=0;u<s;u++){const f=document.createElement("col"),d=a&&a[u];d&&(f.style.width=`${d}px`),c.push(f)}l.replaceChildren(...c)})(n,0,this.getColumnCount(),this.getColWidths()),iv(n,r,this.getFormatType())}updateDOM(t,n,r){const o=this.getDOMSlot(n).element;return n===o===Bl()||(Be(i=n)&&i.nodeName==="DIV"&&this.updateTableWrapper(t,n,o,r),this.updateTableElement(t,o,r),!1);var i}exportDOM(t){const n=super.exportDOM(t),{element:r}=n;return{after:o=>{if(n.after&&(o=n.after(o)),!fi(o)&&Be(o)&&(o=o.querySelector("table")),!fi(o))return null;iv(o,t._config,this.getFormatType());const[i]=Fr(this,null,null),s=new Map;for(const u of i)for(const f of u){const d=f.cell.getKey();s.has(d)||s.set(d,{colSpan:f.cell.getColSpan(),startColumn:f.startColumn})}const a=new Set;for(const u of o.querySelectorAll(":scope > tr > [data-temporary-table-cell-lexical-key]")){const f=u.getAttribute("data-temporary-table-cell-lexical-key");if(f){const d=s.get(f);if(u.removeAttribute("data-temporary-table-cell-lexical-key"),d){s.delete(f);for(let h=0;h<d.colSpan;h++)a.add(h+d.startColumn)}}}const l=o.querySelector(":scope > colgroup");if(l){const u=Array.from(o.querySelectorAll(":scope > colgroup > col")).filter((f,d)=>a.has(d));l.replaceChildren(...u)}const c=o.querySelectorAll(":scope > tr");if(c.length>0){const u=document.createElement("tbody");for(const f of c)u.appendChild(f);o.append(u)}return o},element:!fi(r)&&Be(r)?r.querySelector("table"):r}}canBeEmpty(){return!1}isShadowRoot(){return!0}getCordsFromCellNode(t,n){const{rows:r,domRows:o}=n;for(let i=0;i<r;i++){const s=o[i];if(s!=null)for(let a=0;a<s.length;a++){const l=s[a];if(l==null)continue;const{elem:c}=l,u=mf(this,c);if(u!==null&&t.is(u))return{x:a,y:i}}}throw new Error("Cell not found in table.")}getDOMCellFromCords(t,n,r){const{domRows:o}=r,i=o[n];if(i==null)return null;const s=i[t<i.length?t:i.length-1];return s??null}getDOMCellFromCordsOrThrow(t,n,r){const o=this.getDOMCellFromCords(t,n,r);if(!o)throw new Error("Cell not found at cords.");return o}getCellNodeFromCords(t,n,r){const o=this.getDOMCellFromCords(t,n,r);if(o==null)return null;const i=Ut(o.elem);return ge(i)?i:null}getCellNodeFromCordsOrThrow(t,n,r){const o=this.getCellNodeFromCords(t,n,r);if(!o)throw new Error("Node at cords not TableCellNode.");return o}getRowStriping(){return!!this.getLatest().__rowStriping}setRowStriping(t){const n=this.getWritable();return n.__rowStriping=t,n}setFrozenColumns(t){const n=this.getWritable();return n.__frozenColumnCount=t,n}getFrozenColumns(){return this.getLatest().__frozenColumnCount}setFrozenRows(t){const n=this.getWritable();return n.__frozenRowCount=t,n}getFrozenRows(){return this.getLatest().__frozenRowCount}canSelectBefore(){return!0}canIndent(){return!1}getColumnCount(){const t=this.getFirstChild();if(!t)return 0;let n=0;return t.getChildren().forEach(r=>{ge(r)&&(n+=r.getColSpan())}),n}}function _P(e,t){const n=e.getElementByKey(t.getKey());return n===null&&fe(230),Ai(t,n)}function TP(e){const t=yc();e.hasAttribute("data-lexical-row-striping")&&t.setRowStriping(!0),e.hasAttribute("data-lexical-frozen-column")&&t.setFrozenColumns(1),e.hasAttribute("data-lexical-frozen-row")&&t.setFrozenRows(1);const n=e.querySelector(":scope > colgroup");if(n){let r=[];for(const o of n.querySelectorAll(":scope > col")){let i=o.style.width||"";if(!ng.test(i)&&(i=o.getAttribute("width")||"",!/^\d+$/.test(i))){r=void 0;break}r.push(parseFloat(i))}r&&t.setColWidths(r)}return{after:r=>aw(r,tt),node:t}}function yc(){return Et(new Pn)}function Ze(e){return e instanceof Pn}function EP(e){tt(e.getParent())?e.isEmpty()&&e.append(ve()):e.remove()}function RP(e){Ze(e.getParent())?iw(e,ge):e.remove()}function kP(e){iw(e,tt);const[t]=Fr(e,null,null),n=t.reduce((s,a)=>Math.max(s,a.length),0),r=e.getChildren();for(let s=0;s<t.length;++s){const a=r[s];if(!a)continue;tt(a)||fe(254,a.constructor.name,a.getType());const l=t[s].reduce((c,u)=>u?1+c:c,0);if(l!==n)for(let c=l;c<n;++c){const u=un();u.append(ve()),a.append(u)}}const o=e.getColWidths(),i=e.getColumnCount();if(o&&o.length!==i){let s;if(i<o.length)s=o.slice(0,i);else if(o.length>0){const a=o[o.length-1];s=[...o,...Array(i-o.length).fill(a)]}e.setColWidths(s)}}function AP(e){if(e.detail<3||!Cn(e.target))return!1;const t=Ut(e.target);if(t===null)return!1;const n=we(t,r=>B(r)&&!r.isInline());return n===null?!1:!!ge(n.getParent())&&(n.select(0),!0)}function NP(e){return e.registerNodeTransform(Mn,t=>{if(t.getColSpan()>1||t.getRowSpan()>1){const[,,n]=zn(t),[r]=an(n,t,t),o=r.length,i=r[0].length;let s=n.getFirstChild();tt(s)||fe(175);const a=[];for(let l=0;l<o;l++){l!==0&&(s=s.getNextSibling(),tt(s)||fe(175));let c=null;for(let u=0;u<i;u++){const f=r[l][u],d=f.cell;if(f.startRow===l&&f.startColumn===u)c=d,a.push(d);else if(d.getColSpan()>1||d.getRowSpan()>1){ge(d)||fe(176);const h=un(d.__headerState);c!==null?c.insertAfter(h):tN(s,h)}}}for(const l of a)l.setColSpan(1),l.setRowSpan(1)}})}function MP(e,t=!0){const n=new Map,r=(i,s,a)=>{const l=Do(i,a),c=xP(i,l,e,t);n.set(s,[c,l])},o=e.registerMutationListener(Pn,i=>{e.getEditorState().read(()=>{for(const[s,a]of i){const l=n.get(s);if(a==="created"||a==="updated"){const{tableNode:c,tableElement:u}=oC(s);l===void 0?r(c,s,u):u!==l[1]&&(l[0].removeListeners(),n.delete(s),r(c,s,u))}else a==="destroyed"&&l!==void 0&&(l[0].removeListeners(),n.delete(s))}},{editor:e})},{skipInitialization:!1});return()=>{o();for(const[,[i]]of n)i.removeListeners()}}function PP(e,t){e.hasNodes([Pn])||fe(255);const{hasNestedTables:n=uw(!1)}=t??{};return Nn(e.registerCommand(tC,r=>(function({rows:o,columns:i,includeHeaders:s},a){const l=X()||Zn();if(!l||!W(l)||!a&&Ni(l.anchor.getNode()))return!1;const c=iP(Number(o),Number(i),s);QA(c);const u=c.getFirstDescendant();return J(u)&&u.select(),!0})(r,n.peek()),be),e.registerCommand(mh,({nodes:r,selection:o},i)=>n.peek()||e!==i||!W(o)?!1:Ni(o.anchor.getNode())!==null&&r.some(Ze),be),e.registerCommand(Ql,AP,be),e.registerNodeTransform(Pn,kP),e.registerNodeTransform(Ur,RP),e.registerNodeTransform(Mn,EP))}function LP({hasCellMerge:e=!0,hasCellBackgroundColor:t=!0,hasTabHandler:n=!0,hasHorizontalScroll:r=!1,hasNestedTables:o=!1}){const[i]=lt();S.useEffect(()=>{Bl(i)!==r&&(SP(i,r),i.registerNodeTransform(Pn,()=>{})())},[i,r]);const s=S.useMemo(()=>uw(!1),[]);return s.peek()!==o&&(s.value=o),S.useEffect(()=>PP(i,{hasNestedTables:s}),[i,s]),S.useEffect(()=>MP(i,n),[i,n]),S.useEffect(()=>{if(!e)return NP(i)},[i,e]),S.useEffect(()=>{if(!t)return i.registerNodeTransform(Mn,a=>{a.getBackgroundColor()!==null&&a.setBackgroundColor(null)})},[i,t,e]),null}var xu,sv;function lC(){if(sv)return xu;sv=1;function e(t){var n=typeof t;return t!=null&&(n=="object"||n=="function")}return xu=e,xu}var bu,av;function FP(){if(av)return bu;av=1;var e=typeof Bn=="object"&&Bn&&Bn.Object===Object&&Bn;return bu=e,bu}var wu,lv;function cC(){if(lv)return wu;lv=1;var e=FP(),t=typeof self=="object"&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return wu=n,wu}var Cu,cv;function $P(){if(cv)return Cu;cv=1;var e=cC(),t=function(){return e.Date.now()};return Cu=t,Cu}var Su,uv;function OP(){if(uv)return Su;uv=1;var e=/\s/;function t(n){for(var r=n.length;r--&&e.test(n.charAt(r)););return r}return Su=t,Su}var _u,dv;function IP(){if(dv)return _u;dv=1;var e=OP(),t=/^\s+/;function n(r){return r&&r.slice(0,e(r)+1).replace(t,"")}return _u=n,_u}var Tu,fv;function uC(){if(fv)return Tu;fv=1;var e=cC(),t=e.Symbol;return Tu=t,Tu}var Eu,hv;function DP(){if(hv)return Eu;hv=1;var e=uC(),t=Object.prototype,n=t.hasOwnProperty,r=t.toString,o=e?e.toStringTag:void 0;function i(s){var a=n.call(s,o),l=s[o];try{s[o]=void 0;var c=!0}catch{}var u=r.call(s);return c&&(a?s[o]=l:delete s[o]),u}return Eu=i,Eu}var Ru,gv;function jP(){if(gv)return Ru;gv=1;var e=Object.prototype,t=e.toString;function n(r){return t.call(r)}return Ru=n,Ru}var ku,pv;function VP(){if(pv)return ku;pv=1;var e=uC(),t=DP(),n=jP(),r="[object Null]",o="[object Undefined]",i=e?e.toStringTag:void 0;function s(a){return a==null?a===void 0?o:r:i&&i in Object(a)?t(a):n(a)}return ku=s,ku}var Au,mv;function BP(){if(mv)return Au;mv=1;function e(t){return t!=null&&typeof t=="object"}return Au=e,Au}var Nu,yv;function zP(){if(yv)return Nu;yv=1;var e=VP(),t=BP(),n="[object Symbol]";function r(o){return typeof o=="symbol"||t(o)&&e(o)==n}return Nu=r,Nu}var Mu,vv;function HP(){if(vv)return Mu;vv=1;var e=IP(),t=lC(),n=zP(),r=NaN,o=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,s=/^0o[0-7]+$/i,a=parseInt;function l(c){if(typeof c=="number")return c;if(n(c))return r;if(t(c)){var u=typeof c.valueOf=="function"?c.valueOf():c;c=t(u)?u+"":u}if(typeof c!="string")return c===0?c:+c;c=e(c);var f=i.test(c);return f||s.test(c)?a(c.slice(2),f?2:8):o.test(c)?r:+c}return Mu=l,Mu}var Pu,xv;function WP(){if(xv)return Pu;xv=1;var e=lC(),t=$P(),n=HP(),r="Expected a function",o=Math.max,i=Math.min;function s(a,l,c){var u,f,d,h,g,p,m=0,v=!1,y=!1,x=!0;if(typeof a!="function")throw new TypeError(r);l=n(l)||0,e(c)&&(v=!!c.leading,y="maxWait"in c,d=y?o(n(c.maxWait)||0,l):d,x="trailing"in c?!!c.trailing:x);function b(j){var I=u,$=f;return u=f=void 0,m=j,h=a.apply($,I),h}function w(j){return m=j,g=setTimeout(R,l),v?b(j):h}function _(j){var I=j-p,$=j-m,H=l-I;return y?i(H,d-$):H}function E(j){var I=j-p,$=j-m;return p===void 0||I>=l||I<0||y&&$>=d}function R(){var j=t();if(E(j))return k(j);g=setTimeout(R,_(j))}function k(j){return g=void 0,x&&u?b(j):(u=f=void 0,h)}function M(){g!==void 0&&clearTimeout(g),m=0,u=p=f=g=void 0}function F(){return g===void 0?h:k(t())}function D(){var j=t(),I=E(j);if(u=arguments,f=this,p=j,I){if(g===void 0)return w(p);if(y)return clearTimeout(g),g=setTimeout(R,l),b(p)}return g===void 0&&(g=setTimeout(R,l)),h}return D.cancel=M,D.flush=F,D}return Pu=s,Pu}var KP=WP();const UP=Lf(KP),GP=e=>N.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M1.61342 8.47549C1.52262 8.33173 1.47723 8.25985 1.45182 8.14898C1.43273 8.06571 1.43273 7.93437 1.45182 7.8511C1.47723 7.74023 1.52262 7.66835 1.61341 7.52459C2.36369 6.3366 4.59693 3.33337 8.00027 3.33337C11.4036 3.33337 13.6369 6.3366 14.3871 7.52459C14.4779 7.66835 14.5233 7.74023 14.5487 7.8511C14.5678 7.93437 14.5678 8.06571 14.5487 8.14898C14.5233 8.25985 14.4779 8.33173 14.3871 8.47549C13.6369 9.66348 11.4036 12.6667 8.00027 12.6667C4.59693 12.6667 2.36369 9.66348 1.61342 8.47549Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),N.createElement("path",{d:"M8.00027 10C9.10484 10 10.0003 9.10461 10.0003 8.00004C10.0003 6.89547 9.10484 6.00004 8.00027 6.00004C6.8957 6.00004 6.00027 6.89547 6.00027 8.00004C6.00027 9.10461 6.8957 10 8.00027 10Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),dC=e=>N.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M16 6V5.2C16 4.0799 16 3.51984 15.782 3.09202C15.5903 2.71569 15.2843 2.40973 14.908 2.21799C14.4802 2 13.9201 2 12.8 2H11.2C10.0799 2 9.51984 2 9.09202 2.21799C8.71569 2.40973 8.40973 2.71569 8.21799 3.09202C8 3.51984 8 4.0799 8 5.2V6M10 11.5V16.5M14 11.5V16.5M3 6H21M19 6V17.2C19 18.8802 19 19.7202 18.673 20.362C18.3854 20.9265 17.9265 21.3854 17.362 21.673C16.7202 22 15.8802 22 14.2 22H9.8C8.11984 22 7.27976 22 6.63803 21.673C6.07354 21.3854 5.6146 20.9265 5.32698 20.362C5 19.7202 5 18.8802 5 17.2V6",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}));function fC(e){return e instanceof jo}function hC(e){return new jo(e)}const{color:ji,cornerRadius:qP,spacing:YP,transition:XP}=V,ZP=T.css({display:"inline-flex",color:ji.text.accent,textDecoration:"underline",cursor:"pointer"}),JP=T.css({color:ji.text.accent,":hover":{color:ji.text.accentHover}}),QP=T.css({width:"16px",height:"16px",color:ji.icon.negative,cursor:"pointer",transition:XP.general,":hover":{color:ji.icon.negativeHover}}),e6=T.css({boxShadow:`0 2px 10px 4px ${ji.effect.shadowL}`,borderRadius:qP.md,padding:YP.sm});function t6({url:e,text:t,nodeKey:n}){const[r]=lt(),{isEditable:o}=ta(),i=S.useCallback(()=>{r.update(()=>{const s=Pe(n);fC(s)&&s.remove()})},[r,n]);return C.jsx(Or,{content:C.jsxs(q,{flex:!0,row:!0,center:!0,gap:"var(--spacing-xs)",children:[C.jsx("a",{className:JP,target:"_blank",href:e,children:e}),o&&C.jsx(dC,{className:QP,onClick:i})]}),placement:"right-start",trigger:"hover",contentClassName:e6,children:C.jsx(le,{className:ZP,children:t})})}const Lu="custom-link-node";class jo extends ia{_url;_text;constructor({url:t,text:n},r){super(r),this._url=t,this._text=n}getType(){return Lu}getData(){return{url:this._url,text:this._text}}isInline(){return!0}isIsolated(){return!1}createDOM(){const t=document.createElement("span");return t.style.display="inline",t}updateDOM(){return!1}decorate(){return C.jsx(t6,{...this.getData(),nodeKey:this.getKey()})}exportJSON(){return{...super.exportJSON(),format:"left",type:Lu,version:1,text:this._text,url:this._url}}static importJSON(t){return new jo({url:t.url,text:t.text})}static getType(){return Lu}static clone(t){return new jo({url:t._url,text:t._text},t.__key)}}const n6={type:"text-match",dependencies:[jo],regExp:/\[([^\]]+)]\(([^)]+)\)/,trigger:")",importRegExp:/\[([^\]]+)]\(([^)]+)\)/,replace:(e,t)=>{const[,n,r]=t,o=hC({url:r,text:n});e.replace(o)},export:e=>{if(!fC(e))return null;const{text:n,url:r}=e.getData();return!r||!n?"":`[${n}](${r})`}},bv="image-row",r6=T.css({width:"fit-content",display:"flex",alignItems:"center"});function gC(e){return e.length?new Gr(e):null}function pC(e){return e instanceof Gr}const{color:vf,cornerRadius:mC,spacing:o6,transition:i6}=V,s6=T.css({width:"100px",height:"100px",objectFit:"cover",borderRadius:mC.md}),a6=T.css({width:"20px",height:"20px",color:vf.icon.negative,cursor:"pointer",transition:i6.general,":hover":{color:vf.icon.negativeHover}}),l6=T.css({boxShadow:`0 2px 10px 4px ${vf.effect.shadowL}`,borderRadius:mC.xs,padding:o6.xs}),{spacing:c6}=V;function u6({images:e,nodeKey:t}){const[n]=lt(),{isEditable:r}=ta(),o=S.useCallback(()=>{n.update(()=>{const i=Pe(t);pC(i)&&i.remove()})},[n,t]);return C.jsx(Or,{open:r?void 0:!1,content:C.jsx(dC,{className:a6,onClick:o}),placement:"right-start",trigger:"hover",contentClassName:l6,children:C.jsx(q,{w:"full",flex:!0,row:!0,gap:c6.sm,alignItems:"center",children:e.map(({src:i,alt:s})=>C.jsx("img",{src:i,alt:s??"",className:s6},i))})})}class Gr extends ia{images;constructor(t,n){super(n),this.images=t}createDOM(){const t=document.createElement("div");return t.className=r6,t.contentEditable="false",t}updateDOM(){return!1}decorate(){return C.jsx(u6,{images:this.images,nodeKey:this.getKey()})}exportJSON(){return{...super.exportJSON(),format:"left",type:bv,version:1,images:this.images}}static importJSON(t){return new Gr(t.images)}isInline(){return!1}isIsolated(){return!0}isSelectable(){return!0}static getType(){return bv}static clone(t){return new Gr(t.images,t.__key)}}const d6={type:"element",dependencies:[Gr],regExp:/^!\[[^\]]*]\([^)]+\)(?:\s+!\[[^\]]*]\([^)]+\))*$/,replace:(e,t,n)=>{const[r]=n,i=[...r.matchAll(/!\[([^\]]*)]\(([^)]+)\)/g)].map(([a,l,c])=>({alt:l,src:c})),s=gC(i);s&&Rh([s])},export:e=>{if(!(e instanceof Gr))return null;const n=e.images;return n.length?n.map(({src:r,alt:o})=>`![${o}](${r})`).join(" "):""}},f6=e=>N.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("g",null,N.createElement("path",{d:"M8.00008 8.66634C8.36827 8.66634 8.66675 8.36786 8.66675 7.99967C8.66675 7.63148 8.36827 7.33301 8.00008 7.33301C7.63189 7.33301 7.33341 7.63148 7.33341 7.99967C7.33341 8.36786 7.63189 8.66634 8.00008 8.66634Z",fill:"currentColor"}),N.createElement("path",{d:"M12.6667 8.66634C13.0349 8.66634 13.3334 8.36786 13.3334 7.99967C13.3334 7.63148 13.0349 7.33301 12.6667 7.33301C12.2986 7.33301 12.0001 7.63148 12.0001 7.99967C12.0001 8.36786 12.2986 8.66634 12.6667 8.66634Z",fill:"currentColor"}),N.createElement("path",{d:"M3.33341 8.66634C3.7016 8.66634 4.00008 8.36786 4.00008 7.99967C4.00008 7.63148 3.7016 7.33301 3.33341 7.33301C2.96522 7.33301 2.66675 7.63148 2.66675 7.99967C2.66675 8.36786 2.96522 8.66634 3.33341 8.66634Z",fill:"currentColor"}),N.createElement("path",{d:"M8.00008 8.66634C8.36827 8.66634 8.66675 8.36786 8.66675 7.99967C8.66675 7.63148 8.36827 7.33301 8.00008 7.33301C7.63189 7.33301 7.33341 7.63148 7.33341 7.99967C7.33341 8.36786 7.63189 8.66634 8.00008 8.66634Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),N.createElement("path",{d:"M12.6667 8.66634C13.0349 8.66634 13.3334 8.36786 13.3334 7.99967C13.3334 7.63148 13.0349 7.33301 12.6667 7.33301C12.2986 7.33301 12.0001 7.63148 12.0001 7.99967C12.0001 8.36786 12.2986 8.66634 12.6667 8.66634Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),N.createElement("path",{d:"M3.33341 8.66634C3.7016 8.66634 4.00008 8.36786 4.00008 7.99967C4.00008 7.63148 3.7016 7.33301 3.33341 7.33301C2.96522 7.33301 2.66675 7.63148 2.66675 7.99967C2.66675 8.36786 2.96522 8.66634 3.33341 8.66634Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),N.createElement("defs",null)),{color:wv}=V,h6=T.css({cursor:"pointer"}),g6=T.css({":hover":{backgroundColor:wv.fill.bgSecondary},":active":{backgroundColor:wv.fill.bgSecondary}}),{color:Cv,spacing:Sv}=V;function p6({groups:e,toolbarVisibleActionsCount:t,onAction:n,disabled:r}){const[o,i]=S.useState(!1),s=S.useCallback(c=>()=>{r||(c&&c(),i(!1))},[r]),a=S.useCallback(({IconComponent:c,...u},f)=>C.jsxs(q,{className:T.cx(h6,!r&&g6),p:Sv.sm,alignItems:"center",flex:!0,row:!0,gap:Sv.xs,onClick:s(()=>n(u.id,f)),children:[C.jsx(c,{width:20,height:20,color:Cv.icon.tertiary}),C.jsx(le,{variant:"body-2",children:u.label})]},u.id),[r,n,s]),l=S.useMemo(()=>e.map((c,u)=>{const f=u===e.length-1;if(!c.length)return null;const d=c.map((h,g)=>{const m=(u?e.slice(0,u).flat().length:0)+g+t;return a(h,m)});return C.jsxs(S.Fragment,{children:[d,f?null:C.jsx(q,{w:"full",h:1,backgroundColor:Cv.border.neutralAlphaBasic})]},c.flatMap(h=>h.id).join("-"))}),[e,a,t]);return C.jsx(Or,{content:C.jsx(q,{flex:!0,children:l}),placement:"bottom",open:o,onChange:i,children:C.jsx(pr,{size:"xs",color:"no-bg",disabled:r,children:C.jsx(f6,{})})})}const m6=T.css({minWidth:"fit-content"}),y6=e=>{throw new Error("defaultOnImagesUpload function must be overridden")},{spacing:_v}=V;function Tv({onSave:e}){const[t,n]=S.useState(""),[r,o]=S.useState(""),[i,s]=S.useState(null),a=na(),{textPlaceholder:l,linkPlaceholder:c,linkErrorText:u,buttonText:f}=a.toolbar.link,d=S.useMemo(()=>i==="link"?u:null,[i,u]),h=S.useCallback(x=>{try{const b=new URL(x);if(!(b.protocol==="http:"||b.protocol==="https:"))throw new Error("Invalid protocol");return s(null),!0}catch{return s("link"),!1}},[]),g=S.useCallback(x=>{n(x.target.value)},[]),p=S.useCallback(x=>{h(x.target.value),o(x.target.value)},[h]),m=S.useCallback(()=>[()=>h(r)].map(w=>w()).every(Boolean),[r,h]),v=S.useCallback(()=>{n(""),o(""),s(null)},[]),y=S.useCallback(x=>{x.preventDefault(),m()&&(e({text:t||r,url:r}),v())},[r,e,t,m,v]);return S.useEffect(()=>()=>{v()},[]),C.jsx("form",{onSubmit:y,children:C.jsxs(q,{flex:!0,alignItems:"flex-start",p:_v.sm,gap:_v.sm,children:[C.jsx(q,{children:C.jsx(Fi,{placeholder:l,size:"sm",value:t,onChange:g})}),C.jsx(q,{children:C.jsx(Fi,{placeholder:c,size:"sm",value:r,onChange:p,error:!!d,errorText:d||""})}),C.jsx(Br,{size:"xs",width:"auto",type:"submit",children:f})]})})}const Ev=50,Rv=20,kv=1,Av=1;function Nv({onSave:e}){const[t,n]=S.useState(""),[r,o]=S.useState(""),[i,s]=S.useState(null),[a,l]=S.useState(null),c=na(),{maxRowsErrorText:u,maxColumnsErrorText:f,minRowsErrorText:d,minColumnsErrorText:h,rowsPlaceholder:g,columnsPlaceholder:p,buttonText:m}=c.toolbar.table,v=S.useMemo(()=>{switch(i){case"rows-max":return u({current:Number(t),limit:Ev});case"rows-min":return d({current:Number(t),limit:kv});default:return null}},[i,t,u,d]),y=S.useMemo(()=>{switch(a){case"columns-max":return f({current:Number(r),limit:Rv});case"columns-min":return h({current:Number(r),limit:Av});default:return null}},[a,r,f,h]),x=S.useCallback(F=>{try{const D=Number(F);if(D>Ev)throw s("rows-max"),new Error("Rows amount exceeds maximum");if(D<kv)throw s("rows-min"),new Error("Rows amount below minimum");return s(null),!0}catch{return!1}},[]),b=S.useCallback(F=>{try{const D=Number(F);if(D>Rv)throw l("columns-max"),new Error("Columns amount exceeds maximum");if(D<Av)throw l("columns-min"),new Error("Columns amount below minimum");return l(null),!0}catch{return!1}},[]),w=S.useCallback(F=>{const D=Number(F);return!Number.isNaN(D)&&Number.isInteger(D)?D:null},[]),_=S.useCallback(F=>{const D=F.target.value,j=w(D);typeof j=="number"&&(x(D),n(String(j)))},[x,w]),E=S.useCallback(F=>{const D=F.target.value,j=w(D);typeof j=="number"&&(b(D),o(String(j)))},[b,w]),R=S.useCallback(()=>[()=>x(t),()=>b(r)].map(j=>j()).every(Boolean),[r,t,b,x]),k=S.useCallback(()=>{n(""),o(""),s(null),l(null)},[]),M=S.useCallback(F=>{F.preventDefault(),R()&&(e({rows:t,columns:r}),k())},[r,e,t,R,k]);return S.useEffect(()=>()=>{k()},[]),C.jsx("form",{onSubmit:M,children:C.jsxs(q,{flex:!0,alignItems:"flex-start",p:"var(--spacing-sm)",gap:"var(--spacing-sm)",children:[C.jsx(q,{children:C.jsx(Fi,{placeholder:g,size:"sm",value:t,onChange:_,error:!!v,errorText:v||""})}),C.jsx(q,{children:C.jsx(Fi,{placeholder:p,size:"sm",value:r,onChange:E,error:!!y,errorText:y||""})}),C.jsx(Br,{size:"xs",width:"auto",type:"submit",children:m})]})})}function v6({disabled:e=!1}){const[t,n]=S.useState(null),[r]=lt(),o=na(),i=S.useMemo(()=>{const l=o.toolbar.textSize;return[{value:"paragraph",label:l.paragraph,textProps:{variant:"body-2"}},{value:"h1",label:l.h1,textProps:{fontWeight:"semibold",variant:"headline-1"}},{value:"h2",label:l.h2,textProps:{fontWeight:"semibold",variant:"headline-2"}},{value:"h3",label:l.h3,textProps:{fontWeight:"semibold",variant:"headline-3"}}]},[o.toolbar.textSize]),s=S.useCallback(l=>{!l||Array.isArray(l)||r.update(()=>{const c=X();if(!W(c))return;const u=c.anchor.getNode().getTopLevelElement();if(!u)return;const f=l==="paragraph"?ve():wo(l);u.getChildren().forEach(d=>{f.append(d)}),u.replace(f),f.selectEnd()})},[r]),a=S.useCallback(()=>{const l=X();if(!W(l))return null;const c=l.anchor.getNode().getTopLevelElement();return Pw(c)?c.getTag():"paragraph"},[]);return S.useEffect(()=>{const l=r.registerUpdateListener(({editorState:c})=>{c.read(()=>{const u=a();u&&n(u)})});return()=>{l()}},[r,a]),C.jsx(Cg,{size:"xs",items:i,renderDropdownItem:l=>C.jsx(le,{whiteSpace:"nowrap",...l.textProps,children:l.label}),returnedValue:l=>l.value,renderSingleInputItem:l=>l.label,onChange:s,disabled:e,value:t,showDefaultItem:!1})}const{color:hs,cornerRadius:x6,spacing:Fu}=V;function b6({onImagesUpload:e=y6,className:t}){const[n,r]=S.useState(11),[o,i]=S.useState(null),[s,a]=S.useState(null),l=S.useRef(null),{toolbar:c}=na(),u=c.preview,[f]=lt(),{isEditable:d,isPreviewMode:h,setPreviewMode:g}=ta(),{availableActionGroups:p}=rN(),m=S.useRef(null),v=S.useMemo(()=>!d||h,[d,h]),y=S.useMemo(()=>h?u.hide:u.show,[h,u]),{toolbarGroups:x,menuGroups:b}=S.useMemo(()=>{const $=[],H=[];let O=0;for(const P of p){const K=[],G=[];for(const re of P)O+=1,O<=n?K.push(re):G.push(re);K.length&&$.push(K),G.length&&H.push(G)}return{toolbarGroups:$,menuGroups:H}},[p,n]),w=S.useMemo(()=>typeof o=="number"&&o>n-1,[o,n]),_=S.useMemo(()=>typeof s=="number"&&s>n-1,[s,n]),E=S.useCallback($=>{const{text:H,url:O}=$;f.update(()=>{const P=X();if(W(P)){const K=hC({text:H,url:O});P.insertNodes([K]);const G=Fe(" ");K.insertAfter(G),G.select()}}),i(null)},[f]),R=S.useCallback($=>{const{rows:H,columns:O}=$;f.dispatchCommand(tC,{rows:H,columns:O}),a(null)},[f]),k=S.useCallback(()=>{m.current&&m.current.click()},[]),M=S.useCallback(async $=>{try{const H=Array.from($.target.files||[]);if(!H.length)return;const O=await e(H);f.update(()=>{const P=gC(O);P&&Rh([P])})}catch(H){console.error("Error uploading images:",H)}finally{$.target.value=""}},[f,e]),F=S.useCallback(($,H)=>{({[ae.BOLD]:()=>{f.dispatchCommand(Vt,"bold")},[ae.ITALIC]:()=>{f.dispatchCommand(Vt,"italic")},[ae.UNDERLINE]:()=>{f.dispatchCommand(Vt,"underline")},[ae.STRIKETHROUGH]:()=>{f.dispatchCommand(Vt,"strikethrough")},[ae.ALIGN_LEFT]:()=>{f.dispatchCommand(_i,"left")},[ae.ALIGN_CENTER]:()=>{f.dispatchCommand(_i,"center")},[ae.ALIGN_RIGHT]:()=>{f.dispatchCommand(_i,"right")},[ae.LINK]:()=>{i(H)},[ae.IMAGE]:()=>{k()},[ae.TABLE]:()=>{a(H)},[ae.BULLET_LIST]:()=>{f.dispatchCommand(Cw,void 0)},[ae.NUMBERED_LIST]:()=>{f.dispatchCommand(Sw,void 0)}})[$]()},[k,f]),D=S.useMemo(()=>x.map(($,H)=>{const O=x.slice(0,H).reduce((G,re)=>G+re.length,0);if(!$.length)return null;const P=$.map(({IconComponent:G,isActive:re,id:U},Z)=>{const Q=O+Z,ne=re?"neutral":"no-bg";return U===ae.LINK?C.jsx(Or,{content:C.jsx(Tv,{onSave:E}),placement:"bottom",open:o===Q,onChange:oe=>{i(oe?Q:null)},children:C.jsx(pr,{size:"xs",color:"no-bg",disabled:v,children:C.jsx(G,{})})},U):U===ae.TABLE?C.jsx(Or,{content:C.jsx(Nv,{onSave:R}),placement:"bottom",open:s===Q,onChange:oe=>{a(oe?Q:null)},children:C.jsx(pr,{size:"xs",color:ne,disabled:v,children:C.jsx(G,{})})},U):C.jsx(pr,{size:"xs",color:ne,onClick:()=>F(U,Q),disabled:v,children:C.jsx(G,{})},U)});return P.every(G=>!G)?null:C.jsxs(S.Fragment,{children:[P,C.jsx(q,{w:1,h:32,backgroundColor:hs.border.neutralAlphaBasic})]},$.flatMap(G=>G.id).join("-"))}),[x,F,o,v,s,E,R]),j=S.useCallback(()=>{const $=l.current;if(!$)return;const H=$.clientWidth,O=40,P=4,K=1,G=P+K+P+O+P;let re=H-G,U=0;for(const Z of p)if(Z.length){for(const Q of Z){const ne=O+P;if(re-ne>=0)re-=ne,U+=1;else break}re-=K+P}r(U)},[p]),I=S.useMemo(()=>UP(j,20,{}),[j]);return S.useEffect(()=>{if(!l.current)return;const $=new ResizeObserver(()=>{I()});return $.observe(l.current),()=>$.disconnect()},[I]),C.jsxs(q,{backgroundColor:hs.fill.neutralPrimary,border:`1px solid ${hs.border.neutralAlphaBasic}`,borderRadius:x6.md,flex:!0,row:!0,alignItems:"center",justifyContent:"space-between",p:Fu.sm,className:t,children:[C.jsxs(q,{flex:!0,flexGrow:1,row:!0,alignItems:"center",overflow:"hidden",children:[C.jsx("input",{ref:m,type:"file",accept:"image/*",hidden:!0,multiple:!0,onChange:M,disabled:v}),C.jsx(v6,{disabled:v}),C.jsx(Or,{content:C.jsx(Tv,{onSave:E}),placement:"bottom",open:w,onChange:$=>{$||i(null)},children:C.jsx("div",{})}),C.jsx(Or,{content:C.jsx(Nv,{onSave:R}),placement:"bottom",open:_,onChange:$=>{$||a(null)},children:C.jsx("div",{})}),C.jsxs(q,{flex:!0,row:!0,alignItems:"center",gap:Fu.xs,w:"full",ml:Fu.xs,overflow:"hidden",ref:l,children:[D,b.length?C.jsx(p6,{disabled:v,onAction:F,groups:b,toolbarVisibleActionsCount:n}):null]})]}),C.jsx(Br,{width:"auto",size:"xs",color:h?"accent":"neutral",intensity:"secondary",wrapperClassName:m6,onClick:()=>{g($=>!$)},iconLeft:C.jsx(GP,{color:h?hs.icon.accent:hs.icon.secondary}),children:y})]})}const yC=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?S.useLayoutEffect:S.useEffect;function w6({editor:e,ariaActiveDescendant:t,ariaAutoComplete:n,ariaControls:r,ariaDescribedBy:o,ariaErrorMessage:i,ariaExpanded:s,ariaInvalid:a,ariaLabel:l,ariaLabelledBy:c,ariaMultiline:u,ariaOwns:f,ariaRequired:d,autoCapitalize:h,className:g,id:p,role:m="textbox",spellCheck:v=!0,style:y,tabIndex:x,"data-testid":b,...w},_){const[E,R]=S.useState(e.isEditable()),k=S.useCallback(F=>{F&&F.ownerDocument&&F.ownerDocument.defaultView?e.setRootElement(F):e.setRootElement(null)},[e]),M=S.useMemo(()=>(function(...F){return D=>{for(const j of F)typeof j=="function"?j(D):j!=null&&(j.current=D)}})(_,k),[k,_]);return yC(()=>(R(e.isEditable()),e.registerEditableListener(F=>{R(F)})),[e]),C.jsx("div",{"aria-activedescendant":E?t:void 0,"aria-autocomplete":E?n:"none","aria-controls":E?r:void 0,"aria-describedby":o,...i!=null?{"aria-errormessage":i}:{},"aria-expanded":E&&m==="combobox"?!!s:void 0,...a!=null?{"aria-invalid":a}:{},"aria-label":l,"aria-labelledby":c,"aria-multiline":u,"aria-owns":E?f:void 0,"aria-readonly":!E||void 0,"aria-required":d,autoCapitalize:h,className:g,contentEditable:E,"data-testid":b,id:p,ref:M,role:m,spellCheck:v,style:y,tabIndex:x,...w})}const C6=S.forwardRef(w6);function Mv(e){return e.getEditorState().read(Xw(e.isComposing()))}const vC=S.forwardRef(S6);function S6(e,t){const{placeholder:n,...r}=e,[o]=lt();return C.jsxs(C.Fragment,{children:[C.jsx(C6,{editor:o,...r,ref:t}),n!=null&&C.jsx(_6,{editor:o,content:n})]})}function _6({content:e,editor:t}){const n=(function(s){const[a,l]=S.useState(()=>Mv(s));return yC(()=>{function c(){const u=Mv(s);l(u)}return c(),Nn(s.registerUpdateListener(()=>{c()}),s.registerEditableListener(()=>{c()}))},[s]),a})(t),[r,o]=S.useState(t.isEditable());if(S.useLayoutEffect(()=>(o(t.isEditable()),t.registerEditableListener(s=>{o(s)})),[t]),!n)return null;let i=null;return typeof e=="function"?i=e(r):e!==null&&(i=e),i===null?null:C.jsx("div",{"aria-hidden":!0,children:i})}const T6=S.createContext(null),$u={didCatch:!1,error:null};class E6 extends S.Component{constructor(t){super(t),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=$u}static getDerivedStateFromError(t){return{didCatch:!0,error:t}}resetErrorBoundary(...t){const{error:n}=this.state;n!==null&&(this.props.onReset?.({args:t,reason:"imperative-api"}),this.setState($u))}componentDidCatch(t,n){this.props.onError?.(t,n)}componentDidUpdate(t,n){const{didCatch:r}=this.state,{resetKeys:o}=this.props;r&&n.error!==null&&R6(t.resetKeys,o)&&(this.props.onReset?.({next:o,prev:t.resetKeys,reason:"keys"}),this.setState($u))}render(){const{children:t,fallbackRender:n,FallbackComponent:r,fallback:o}=this.props,{didCatch:i,error:s}=this.state;let a=t;if(i){const l={error:s,resetErrorBoundary:this.resetErrorBoundary};if(typeof n=="function")a=n(l);else if(r)a=S.createElement(r,l);else if(o!==void 0)a=o;else throw s}return S.createElement(T6.Provider,{value:{didCatch:i,error:s,resetErrorBoundary:this.resetErrorBoundary}},a)}}function R6(e=[],t=[]){return e.length!==t.length||e.some((n,r)=>!Object.is(n,t[r]))}function xC({children:e,onError:t}){return C.jsx(E6,{fallback:C.jsx("div",{style:{border:"1px solid #f00",color:"#f00",padding:"8px"},children:"An error was thrown."}),onError:t,children:e})}const k6=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?S.useLayoutEffect:S.useEffect;function A6(e){return{initialValueFn:()=>e.isEditable(),subscribe:t=>e.registerEditableListener(t)}}function N6(){return(function(e){const[t]=lt(),n=S.useMemo(()=>e(t),[t,e]),[r,o]=S.useState(()=>n.initialValueFn()),i=S.useRef(r);return k6(()=>{const{initialValueFn:s,subscribe:a}=n,l=s();return i.current!==l&&(i.current=l,o(l)),a(c=>{i.current=c,o(c)})},[n,e]),r})(A6)}const M6={name:"@lexical/react/ReactProvider"};function P6(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const o of t)r.append("v",o);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const sg=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?S.useLayoutEffect:S.useEffect;function L6({editor:e,ErrorBoundary:t}){return(function(n,r){const[o,i]=S.useState(()=>n.getDecorators());return sg(()=>n.registerDecoratorListener(s=>{$s.flushSync(()=>{i(s)})}),[n]),S.useEffect(()=>{i(n.getDecorators())},[n]),S.useMemo(()=>{const s=[],a=Object.keys(o);for(let l=0;l<a.length;l++){const c=a[l],u=C.jsx(r,{onError:d=>n._onError(d),children:C.jsx(S.Suspense,{fallback:null,children:o[c]})}),f=n.getElementByKey(c);f!==null&&s.push($s.createPortal(u,f,c))}return s},[r,o,n])})(e,t)}function F6({editor:e,ErrorBoundary:t}){return(function(n){const r=gN.maybeFromEditor(n);if(r&&r.hasExtensionByName(M6.name)){for(const o of["@lexical/plain-text","@lexical/rich-text"])r.hasExtensionByName(o)&&P6(320,o);return!0}return!1})(e)?null:C.jsx(L6,{editor:e,ErrorBoundary:t})}function Pv(e){return e.getEditorState().read(Xw(e.isComposing()))}function bC({contentEditable:e,placeholder:t=null,ErrorBoundary:n}){const[r]=lt();return(function(o){sg(()=>Nn(WN(o),ON(o)),[o])})(r),C.jsxs(C.Fragment,{children:[e,C.jsx($6,{content:t}),C.jsx(F6,{editor:r,ErrorBoundary:n})]})}function $6({content:e}){const[t]=lt(),n=(function(o){const[i,s]=S.useState(()=>Pv(o));return sg(()=>{function a(){const l=Pv(o);s(l)}return a(),Nn(o.registerUpdateListener(()=>{a()}),o.registerEditableListener(()=>{a()}))},[o]),i})(t),r=N6();return n?typeof e=="function"?e(r):e:null}const O6=T.css({width:"100%"}),I6=T.css({pointerEvents:"none"});function D6(e){const{placeholder:t,className:n}=e||{},r=S.useRef(null),{alignment:o}=cw(),i=S.useCallback(a=>{if(!t)return null;const l=typeof t=="string"||typeof t=="object"&&t.hasWrapper,c=typeof t=="string"?t:t.renderContent(a);return l?C.jsx(le,{variant:"body-2",colorName:"tertiary",children:c}):C.jsx(C.Fragment,{children:c})},[t]),s=S.useCallback(a=>{const l=i(a);if(!l)return null;const c={left:"flex-start",center:"center",right:"flex-end"};return C.jsx(q,{absolute:!0,w:"full",top:0,left:0,alignItems:c[o],className:I6,children:l})},[i,o]);return C.jsx(q,{relative:!0,row:!0,w:"full",flexGrow:1,className:n,children:C.jsx(bC,{contentEditable:C.jsx(vC,{ref:r,className:O6,"aria-placeholder":"markdown editor",placeholder:s}),ErrorBoundary:xC})})}const{color:j6,spacing:V6}=V,B6=T.css({counterReset:"line"}),z6=T.css({display:"grid",gridTemplateColumns:"3ch 1fr",columnGap:V6.sm,whiteSpace:"pre-wrap",":before":{counterIncrement:"line",content:"counter(line)",color:j6.text.accent,userSelect:"none",textAlign:"right"}});function H6({className:e,lineClassName:t}={}){const{markdownText:n}=ta(),r=n.split(`
65
+ `);return C.jsx("pre",{className:T.cx(B6,e),children:r.map((o,i)=>C.jsx(le,{tag:"span",className:T.cx(z6,t),children:o||" "},i))})}const ri={text:T.css({fontFamily:"Inter, sans-serif"}),paragraph:T.css({...ye.body2}),h1:T.css({...ye.headline1}),h2:T.css({...ye.headline2}),h3:T.css({...ye.headline3}),h4:T.css({...ye.body2})},{color:ag,spacing:Lv}=V,W6=T.css({borderSpacing:"0",borderCollapse:"separate"}),K6=T.css({border:`1px solid ${ag.border.neutralPrimary}`,padding:`${Lv.sm} ${Lv.sm}`}),U6=T.css({color:ag.text.accent}),G6=T.css({fontWeight:"bold"}),q6=T.css({textDecoration:"underline"}),Y6=T.css({textDecoration:"line-through"}),X6=T.css({textDecoration:"underline line-through"}),Z6=T.css({fontStyle:"italic"}),J6=T.css({color:ag.text.accent,textDecoration:"underline"}),Q6={table:W6,tableCell:K6,hashtag:U6,link:J6,text:{base:ri.text,bold:G6,underline:q6,strikethrough:Y6,underlineStrikethrough:X6,italic:Z6},heading:{h1:ri.h1,h2:ri.h2,h3:ri.h3,h4:ri.h4},paragraph:ri.paragraph};function wC(){return{namespace:"ui-kit-markdown-text-editor",nodes:[Wo,fn,Uo,eo,Pn,Mn,Ur,Gr,jo,pc,hc,fc,gc,da,fa],onError(e){throw e},theme:Q6}}const eL=[[ae.BOLD,ae.ITALIC,ae.UNDERLINE,ae.STRIKETHROUGH],[ae.LINK,ae.IMAGE],[ae.ALIGN_LEFT,ae.ALIGN_CENTER,ae.ALIGN_RIGHT],[ae.TABLE],[ae.BULLET_LIST,ae.NUMBERED_LIST]];function tL(){const[e]=lt(),{isEditable:t}=ta();return S.useEffect(()=>{e.setEditable(t)},[e,t]),null}function nL(){const[e]=lt();return S.useEffect(()=>{const t=e.registerCommand(ec,()=>{const n=X();if(!W(n)||!n.isCollapsed()||n.anchor.offset!==0)return!1;const o=n.anchor.getNode().getTopLevelElement();if(!o||o.getType()!=="paragraph"||o.getTextContent()!=="")return!1;const i=o.getPreviousSibling();return pC(i)?(i.remove(),o.select(),!0):!1},Dt);return()=>{t()}},[e]),null}const rL=/^\|(.+)\|$/,oL=/^\|\s*:?-+:?\s*(\|\s*:?-+:?\s*)+\|$/,iL=/^\|(.+)\|$/,sL={type:"multiline-element",dependencies:[Pn,Ur,Mn],regExpStart:rL,handleImportAfterStartMatch({lines:e,rootNode:t,startLineIndex:n}){const r=e[n+1];if(!oL.test(r??""))return null;const o=yc();let i=n;for(;i<e.length&&iL.test(e[i]);){if(i===n+1){i++;continue}const s=Di(),a=e[i].slice(1,-1).split("|").map(c=>c.trim()),l=i===n;a.forEach(c=>{const u=un(l?st.ROW:void 0);u.append(Fe(c)),s.append(u)}),o.append(s),i++}return t.append(o),[!0,i-1]},replace(){return!0},export(e){if(!(e instanceof Pn))return null;const n=e.getChildren();if(!n.length)return"";const r=[];return n.forEach((o,i)=>{if(!(o instanceof Ur))return;const a=o.getChildren().map(l=>l instanceof Mn?l.getTextContent().replace(/\n/g," ").trim():"");r.push(`| ${a.join(" | ")} |`),i||r.push(`| ${a.map(()=>"---").join(" | ")} |`)}),r.join(`
66
+ `)}},zl=[sL,d6,n6,...ha];function aL({defaultValue:e}){const[t]=lt();return S.useEffect(()=>{t.update(()=>{e&&Gw(e,zl)})},[t]),null}const{color:Ou,cornerRadius:Fv,spacing:Ha}=V;function lL({label:e,plugins:t,field:n,disabled:r=!1,locale:o,toolbar:i,defaultMarkdown:s,events:a={},className:l,labelClassName:c,toolbarClassName:u,editorClassName:f,fieldClassName:d,previewClassName:h}){const[g,p]=S.useState(""),[m,v]=S.useState(!1),{availableActions:y,onImagesUpload:x}=i||{},b=S.useMemo(()=>wC(),[]),w=S.useMemo(()=>({isEditable:!r,isPreviewMode:m,setPreviewMode:v,markdownText:g}),[r,m,g]),_=S.useMemo(()=>({availableActions:y||eL}),[y]),E=S.useCallback(k=>{p(k),a.onMarkdownChange&&a.onMarkdownChange(k)},[a]),R=S.useCallback(k=>{k.read(()=>{const M=IM(zl);E(M),a.onEditorStateChange&&a.onEditorStateChange(k)})},[E,a]);return C.jsx(l3,{locale:o,children:C.jsx(Yw,{initialConfig:b,children:C.jsx(gh.Provider,{value:w,children:C.jsxs(Eb.Provider,{value:_,children:[C.jsxs(q,{flex:!0,w:"full",borderRadius:Fv.lg,p:Ha.lg,gap:Ha.sm,backgroundColor:Ou.fill.neutralSecondary,className:l,children:[e?C.jsx(le,{variant:"headline-3",fontWeight:"semibold",className:c,children:e}):null,C.jsx(b6,{onImagesUpload:x,className:u}),C.jsx(q,{backgroundColor:Ou.fill.neutralPrimary,border:`1px solid ${Ou.border.neutralAlphaBasic}`,borderRadius:Fv.md,p:`${Ha.md} ${Ha.lg}`,w:"full",h:144,overflow:"auto",className:f,children:m?C.jsx(H6,{className:h}):C.jsx(D6,{...n,className:d})})]}),C.jsx(DM,{}),C.jsx(YM,{}),C.jsx(LP,{}),C.jsx(qM,{}),C.jsx(eP,{transformers:zl}),C.jsx(nP,{onChange:R}),C.jsx(tL,{}),C.jsx(aL,{defaultValue:s}),C.jsx(nL,{}),t]})})})})}const{color:vn}=V,oi={input:T.css({...ye.common,...ye.body1,width:48,height:48,textAlign:"center",borderRadius:12,border:`1px solid ${vn.border.neutralAlphaBasic}`,color:vn.text.primary,outline:"none",transition:"border-color 0.5s ease, background-color 0.5s ease, box-shadow 0.5s ease","&::placeholder":{color:vn.text.tertiary},"&:focus-visible":{borderColor:vn.border.accentPrimary,boxShadow:`0 0 0 1px ${vn.border.accentPrimary}`},"&:not(.disabled):hover":{backgroundColor:vn.fill.neutralPrimaryHover},"&:disabled":{opacity:.6,cursor:"not-allowed"}}),error:T.css({borderColor:vn.border.negativePrimary}),success:T.css({borderColor:vn.border.positivePrimary}),disabled:T.css({pointerEvents:"none",opacity:.5}),white:T.css({background:vn.fill.bgPrimary}),gray:T.css({background:vn.fill.bgSecondary}),glow:T.css({position:"absolute",inset:0,borderRadius:12,pointerEvents:"none",opacity:0,transformOrigin:"center",background:vn.fill.accentPrimary})};function cL(e){const t=S.useRef(void 0);return S.useEffect(()=>{t.current=e},[e]),t.current}const{spacing:$v}=V,CC=S.forwardRef(({length:e=6,label:t,prompt:n,error:r,errorText:o,success:i,disabled:s,autoFocus:a,center:l,secure:c,loading:u,background:f="gray",numeric:d=!0,className:h,inputsContainerClassName:g,inputClassName:p,labelClassName:m,promptClassName:v,errorClassName:y,value:x,defaultValue:b,onChange:w,onComplete:_},E)=>{const R=typeof x=="string",k=R?x:b,M=typeof k=="string"?k.slice(0,e):"",[F,D]=Bo(R?x:void 0,M),[j,I]=S.useState(()=>{const U=M.slice(0,e);return Array.from({length:e},(Z,Q)=>U[Q]??"")}),$=S.useRef(void 0),H=cL(x),O=S.useRef([]);S.useEffect(()=>{if(!R)return;const U=x??"";if(U===H)return;if(U===$.current){$.current=void 0;return}const Z=U.slice(0,e);I(Array.from({length:e},(Q,ne)=>Z[ne]??""))},[R,x,e,H]);const P=S.useCallback((U,Z)=>{const Q=U.slice(0,e);Z?.fromInternal&&($.current=Q),D(Q),w?.(Q),Q.length===e&&_?.(Q)},[e,w,_,D]);S.useImperativeHandle(E,()=>({focus:()=>{O.current[0]?.focus()},blur:()=>{O.current.forEach(U=>U?.blur())},get value(){return F||""},setValue:U=>{const Z=U.slice(0,e);I(Array.from({length:e},(Q,ne)=>Z[ne]??"")),P(Z,{fromInternal:!0})},clear:()=>{I(Array.from({length:e},()=>"")),P("",{fromInternal:!0})}}),[e,P,F]);const K=S.useCallback((U,Z)=>{if(s)return;let Q=Z;if(d&&(Q=Q.replace(/\D/g,"")),Q.length>1){const ee=j.slice(0,U).join("")+Q+j.slice(U+1).join(""),xe=Array.from({length:e},(ze,je)=>ee[je]??"");I(xe),P(ee,{fromInternal:!0});const Se=Math.min(U+Q.length,e-1),Ee=O.current[Se];Ee?.focus(),Ee?.select();return}const ne=j[U],oe=[...j];oe[U]=Q,I(oe);const me=oe.join("");if(P(me,{fromInternal:!0}),!ne&&Q&&U<e-1){const ee=O.current[U+1];ee?.focus(),ee?.select()}},[j,s,e,d,P]),G=S.useCallback((U,Z)=>{if(!s){if(Z.key==="Backspace"){Z.preventDefault();const Q=O.current[U];if(j[U]){const ne=[...j];ne[U]="",I(ne),P(ne.join(""),{fromInternal:!0}),Q?.focus();return}if(U>0){const ne=O.current[U-1];ne?.focus(),ne?.select()}return}Z.key==="ArrowLeft"&&U>0&&(Z.preventDefault(),O.current[U-1]?.focus()),Z.key==="ArrowRight"&&U<e-1&&(Z.preventDefault(),O.current[U+1]?.focus())}},[j,s,e,P]),re=S.useCallback((U,Z)=>{if(s)return;Z.preventDefault();let Q=Z.clipboardData.getData("text");if(d&&(Q=Q.replace(/\D/g,"")),!Q)return;const ne=e-U,oe=Math.min(Q.length,ne),me=Q.slice(0,oe),ee=[...j];for(let ze=0;ze<oe;ze++)ee[U+ze]=me[ze]??"";I(ee);const xe=ee.join("");P(xe,{fromInternal:!0});const Se=Math.min(U+oe-1,e-1),Ee=O.current[Se];Ee?.focus(),Ee?.select()},[j,s,e,d,P]);return C.jsxs(q,{w:"full",gap:$v.sm,className:h,center:l,children:[t&&C.jsx(le,{variant:"body-2",fontWeight:"regular",colorName:"tertiary",className:m,children:t}),C.jsx(q,{row:!0,w:"full",gap:$v.sm,center:l,className:T.cx({[oi.disabled]:s},g),children:Array.from({length:e}).map((U,Z)=>C.jsxs(q,{relative:!0,display:"inline-block",children:[C.jsx("input",{ref:Q=>{O.current[Z]=Q},className:T.cx(oi.input,oi[f],r&&oi.error,i&&oi.success,j[Z]&&T.css({caretColor:"transparent"}),p),inputMode:d?"numeric":"text",type:c?"password":"text",maxLength:1,autoFocus:a&&Z===0,disabled:s||u,value:j[Z],onChange:Q=>K(Z,Q.target.value),onKeyDown:Q=>G(Z,Q),onPaste:Q=>re(Z,Q)}),C.jsx(ea.span,{className:oi.glow,variants:uL,custom:Z,initial:"idle",animate:u?"wave":"idle"})]},Z))}),n&&C.jsx(le,{variant:"caption-1",colorName:"tertiary",className:v,children:n}),o&&r&&C.jsx(le,{variant:"body-2",colorName:"negative",fontWeight:"regular",className:y,children:o})]})}),uL={idle:{opacity:0,scale:1,transition:{duration:.18}},wave:(e=0)=>({opacity:[0,.2,0],scale:[1,1.03,1],transition:{duration:1.5,delay:e*.15,repeat:1/0,ease:[.42,0,.58,1]}})};CC.displayName="OtpInput";const SC=S.createContext(null),dL=()=>S.useContext(SC),{spacing:fL}=V,gs={radio:T.css({display:"flex",alignItems:"flex-start",justifyContent:"flex-start",gap:fL.md,cursor:"pointer"}),disabled:T.css({opacity:.5,cursor:"not-allowed"}),sideRight:T.css({flexDirection:"row-reverse",justifyContent:"space-between"}),readOnly:T.css({cursor:"auto"}),checked:T.css({})},{color:_r,cornerRadius:Ov}=V,Iv={sm:{inner:12,outer:20},md:{inner:16,outer:24}},_C=S.forwardRef(({value:e,children:t,checked:n,defaultChecked:r,onChange:o,disabled:i,className:s,description:a,size:l,side:c,readOnly:u,error:f,outerCircleClassName:d,innerCircleClassName:h,labelContainerClassName:g,labelClassName:p,descriptionClassName:m},v)=>{const y=dL(),x=!!y,b=n!==void 0,[w,_]=Bo(n,r),E=x?y.value===e:b?n:w,R=y?.disabled||i,k=l??y?.size??"md",M=c??y?.side??"left",F=u??y?.readOnly??!1,D=f??y?.error??!1,j=Iv[k].outer,I=Iv[k].inner,$=()=>{R||F||(x?y.setValue?.(e):(b||_(!E),o?.(!E)))},H=E&&D?_r.fill.negativeTint:E?_r.fill.accentTint:_r.fill.bgSecondary,O=E&&D?_r.fill.negativePrimary:E?_r.fill.accentPrimary:void 0,P=E&&D||D&&!E?_r.border.negativeSecondary:_r.border.neutralAlphaLow;return C.jsxs("button",{ref:v,role:"radio",type:"button","data-value":e,"aria-checked":E,"aria-disabled":R||void 0,tabIndex:E?0:-1,className:T.cx([gs.radio,E&&gs.checked,R&&gs.disabled,M==="right"&&gs.sideRight,F&&gs.readOnly,s]),onClick:$,children:[C.jsx(q,{w:j,h:j,backgroundColor:H,borderWidth:E?0:1,borderColor:P,borderStyle:"solid",center:!0,borderRadius:Ov.fullRound,className:d,children:C.jsx(q,{w:I,h:I,backgroundColor:O,borderRadius:Ov.fullRound,"aria-hidden":!0,className:h})}),C.jsxs(q,{alignItems:"flex-start",className:g,children:[C.jsx(le,{variant:k==="sm"?"body-2":"body-1",tag:"span",left:!0,className:p,children:t}),a&&C.jsx(le,{tag:"span",variant:"body-2",colorName:"secondary",className:m,children:a})]})]})});_C.displayName="Radio";const{spacing:Dv}=V,TC=S.forwardRef(({label:e,value:t,defaultValue:n,onChange:r,children:o,className:i,error:s=!1,disabled:a=!1,readOnly:l=!1,side:c="left",size:u="md",labelClassName:f,optionsContainerClassName:d},h)=>{const[g,p]=Bo(t,n),m=t!==void 0,v=m?t:g,y=S.useCallback(b=>{m||p(b),r?.(b)},[m,r,p]),x=S.useRef(null);return S.useImperativeHandle(h,()=>x.current),C.jsx(SC.Provider,{value:{value:v,readOnly:l,disabled:a,setValue:y,size:u,side:c,error:s},children:C.jsxs(q,{gap:Dv.sm,ref:x,role:"radiogroup","aria-invalid":s||void 0,className:i,children:[typeof e=="string"?C.jsx(le,{colorName:"secondary",className:f,children:e}):e,C.jsx(q,{gap:Dv.lg,className:d,children:o})]})})});TC.displayName="RadioGroup";const{color:or}=V,jv=T.css({border:`1px solid ${or.border.neutralAlphaBasic}`}),Vv=T.css({display:"flex",alignItems:"center",justifyContent:"center"}),Tr={primary:T.css({background:or.fill.bgPrimary,border:`1px solid ${or.border.neutralAlphaBasic}`}),secondary:T.css({background:or.fill.bgSecondary,border:`1px solid ${or.border.neutralAlphaBasic}`}),button:T.css({cursor:"pointer",border:"1px solid transparent",borderRadius:8,padding:"8px 12px",display:"inline-flex",alignItems:"center",justifyContent:"center",gap:10,transition:"all 0.15s ease",position:"relative",overflow:"hidden",background:"none",[`&:hover:not(.${jv})`]:{background:or.fill.neutralPrimaryHover},[`& .${Vv} svg`]:{color:or.icon.tertiary},"&:disabled":{cursor:"not-allowed",opacity:.5}}),"button-active":jv,"button-primary":T.css({background:or.fill.bgSecondary}),"button-secondary":T.css({background:or.fill.bgPrimary}),"button-disabled":T.css({opacity:.5,cursor:"not-allowed"}),"full-width":T.css({width:"100%"}),"icon-container":Vv},{color:Bv,cornerRadius:hL,spacing:zv}=V;function gL({value:e,onChange:t,options:n,variant:r="primary",fullWidth:o=!1,className:i,buttonClassName:s,activeButtonClassName:a,disabledButtonClassName:l,iconContainerClassName:c,textClassName:u,separatorClassName:f}){return C.jsx(q,{row:!0,alignItems:"center",borderRadius:hL.md,p:zv.xs,gap:zv.md,className:T.cx(Tr[r],o&&Tr["full-width"],i),children:n.map(d=>{const h=d.value===e,g=d.disabled,p=d.separatorAfter??!1;return C.jsxs(S.Fragment,{children:[C.jsxs("button",{type:"button",disabled:g,className:T.cx(Tr.button,o&&Tr["full-width"],h&&Tr["button-active"],h&&Tr[`button-${r}`],g&&Tr["button-disabled"],s,h&&a,g&&l),onClick:()=>!g&&t(d.value),children:[d.icon&&C.jsx(q,{alignItems:"center",justifyContent:"center",className:T.cx(Tr["icon-container"],c),children:d.icon}),d.label&&C.jsx(le,{colorName:h?"primary":"tertiary",className:u,children:d.label}),!g&&C.jsx(zo,{color:Bv.fill.bgOverlayPrimary})]}),p&&C.jsx(q,{w:1,h:24,backgroundColor:Bv.fill.bgTertiary,className:f})]},d.value)})})}function vc(){return typeof window<"u"}function Ji(e){return EC(e)?(e.nodeName||"").toLowerCase():"#document"}function Wt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Jn(e){var t;return(t=(EC(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function EC(e){return vc()?e instanceof Node||e instanceof Wt(e).Node:!1}function De(e){return vc()?e instanceof Element||e instanceof Wt(e).Element:!1}function $t(e){return vc()?e instanceof HTMLElement||e instanceof Wt(e).HTMLElement:!1}function xf(e){return!vc()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Wt(e).ShadowRoot}const pL=new Set(["inline","contents"]);function ga(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=dn(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!pL.has(o)}const mL=new Set(["table","td","th"]);function yL(e){return mL.has(Ji(e))}const vL=[":popover-open",":modal"];function xc(e){return vL.some(t=>{try{return e.matches(t)}catch{return!1}})}const xL=["transform","translate","scale","rotate","perspective"],bL=["transform","translate","scale","rotate","perspective","filter"],wL=["paint","layout","strict","content"];function lg(e){const t=bc(),n=De(e)?dn(e):e;return xL.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||bL.some(r=>(n.willChange||"").includes(r))||wL.some(r=>(n.contain||"").includes(r))}function CL(e){let t=wr(e);for(;$t(t)&&!mr(t);){if(lg(t))return t;if(xc(t))return null;t=wr(t)}return null}function bc(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const SL=new Set(["html","body","#document"]);function mr(e){return SL.has(Ji(e))}function dn(e){return Wt(e).getComputedStyle(e)}function wc(e){return De(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function wr(e){if(Ji(e)==="html")return e;const t=e.assignedSlot||e.parentNode||xf(e)&&e.host||Jn(e);return xf(t)?t.host:t}function RC(e){const t=wr(e);return mr(t)?e.ownerDocument?e.ownerDocument.body:e.body:$t(t)&&ga(t)?t:RC(t)}function Dr(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=RC(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=Wt(o);if(i){const a=bf(s);return t.concat(s,s.visualViewport||[],ga(o)?o:[],a&&n?Dr(a):[])}return t.concat(o,Dr(o,[],n))}function bf(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const qr=Math.min,Xt=Math.max,Hl=Math.round,Wa=Math.floor,Xn=e=>({x:e,y:e}),_L={left:"right",right:"left",bottom:"top",top:"bottom"},TL={start:"end",end:"start"};function wf(e,t,n){return Xt(e,qr(t,n))}function Qi(e,t){return typeof e=="function"?e(t):e}function Yr(e){return e.split("-")[0]}function es(e){return e.split("-")[1]}function kC(e){return e==="x"?"y":"x"}function cg(e){return e==="y"?"height":"width"}const EL=new Set(["top","bottom"]);function gr(e){return EL.has(Yr(e))?"y":"x"}function ug(e){return kC(gr(e))}function RL(e,t,n){n===void 0&&(n=!1);const r=es(e),o=ug(e),i=cg(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=Wl(s)),[s,Wl(s)]}function kL(e){const t=Wl(e);return[Cf(e),t,Cf(t)]}function Cf(e){return e.replace(/start|end/g,t=>TL[t])}const Hv=["left","right"],Wv=["right","left"],AL=["top","bottom"],NL=["bottom","top"];function ML(e,t,n){switch(e){case"top":case"bottom":return n?t?Wv:Hv:t?Hv:Wv;case"left":case"right":return t?AL:NL;default:return[]}}function PL(e,t,n,r){const o=es(e);let i=ML(Yr(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(Cf)))),i}function Wl(e){return e.replace(/left|right|bottom|top/g,t=>_L[t])}function LL(e){return{top:0,right:0,bottom:0,left:0,...e}}function AC(e){return typeof e!="number"?LL(e):{top:e,right:e,bottom:e,left:e}}function Kl(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function FL(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function $L(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:r}=t;return n+"/"+r}).join(" "):navigator.userAgent}function OL(){return/apple/i.test(navigator.vendor)}function IL(){return FL().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function DL(){return $L().includes("jsdom/")}const Kv="data-floating-ui-focusable",jL="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function Uv(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function Gs(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&xf(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function hi(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Iu(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function VL(e){return e.matches("html,body")}function Co(e){return e?.ownerDocument||document}function NC(e){return $t(e)&&e.matches(jL)}function BL(e){if(!e||DL())return!0;try{return e.matches(":focus-visible")}catch{return!0}}function zL(e){return e?e.hasAttribute(Kv)?e:e.querySelector("["+Kv+"]")||e:null}function cl(e,t,n){return n===void 0&&(n=!0),e.filter(o=>{var i;return o.parentId===t&&(!n||((i=o.context)==null?void 0:i.open))}).flatMap(o=>[o,...cl(e,o.id,n)])}function HL(e){return"nativeEvent"in e}function qs(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}var WL=typeof document<"u",KL=function(){},Vi=WL?S.useLayoutEffect:KL;const UL={...N};function Ka(e){const t=N.useRef(e);return Vi(()=>{t.current=e}),t}const GL=UL.useInsertionEffect,qL=GL||(e=>e());function Vn(e){const t=N.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return qL(()=>{t.current=e}),N.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}function Gv(e,t,n){let{reference:r,floating:o}=e;const i=gr(t),s=ug(t),a=cg(s),l=Yr(t),c=i==="y",u=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,d=r[a]/2-o[a]/2;let h;switch(l){case"top":h={x:u,y:r.y-o.height};break;case"bottom":h={x:u,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:f};break;case"left":h={x:r.x-o.width,y:f};break;default:h={x:r.x,y:r.y}}switch(es(t)){case"start":h[s]-=d*(n&&c?-1:1);break;case"end":h[s]+=d*(n&&c?-1:1);break}return h}const YL=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:f}=Gv(c,r,l),d=r,h={},g=0;for(let p=0;p<a.length;p++){const{name:m,fn:v}=a[p],{x:y,y:x,data:b,reset:w}=await v({x:u,y:f,initialPlacement:r,placement:d,strategy:o,middlewareData:h,rects:c,platform:s,elements:{reference:e,floating:t}});u=y??u,f=x??f,h={...h,[m]:{...h[m],...b}},w&&g<=50&&(g++,typeof w=="object"&&(w.placement&&(d=w.placement),w.rects&&(c=w.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):w.rects),{x:u,y:f}=Gv(c,d,l)),p=-1)}return{x:u,y:f,placement:d,strategy:o,middlewareData:h}};async function dg(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:d=!1,padding:h=0}=Qi(t,e),g=AC(h),m=a[d?f==="floating"?"reference":"floating":f],v=Kl(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(m)))==null||n?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),y=f==="floating"?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,x=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),b=await(i.isElement==null?void 0:i.isElement(x))?await(i.getScale==null?void 0:i.getScale(x))||{x:1,y:1}:{x:1,y:1},w=Kl(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:y,offsetParent:x,strategy:l}):y);return{top:(v.top-w.top+g.top)/b.y,bottom:(w.bottom-v.bottom+g.bottom)/b.y,left:(v.left-w.left+g.left)/b.x,right:(w.right-v.right+g.right)/b.x}}const XL=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:l}=t,{element:c,padding:u=0}=Qi(e,t)||{};if(c==null)return{};const f=AC(u),d={x:n,y:r},h=ug(o),g=cg(h),p=await s.getDimensions(c),m=h==="y",v=m?"top":"left",y=m?"bottom":"right",x=m?"clientHeight":"clientWidth",b=i.reference[g]+i.reference[h]-d[h]-i.floating[g],w=d[h]-i.reference[h],_=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let E=_?_[x]:0;(!E||!await(s.isElement==null?void 0:s.isElement(_)))&&(E=a.floating[x]||i.floating[g]);const R=b/2-w/2,k=E/2-p[g]/2-1,M=qr(f[v],k),F=qr(f[y],k),D=M,j=E-p[g]-F,I=E/2-p[g]/2+R,$=wf(D,I,j),H=!l.arrow&&es(o)!=null&&I!==$&&i.reference[g]/2-(I<D?M:F)-p[g]/2<0,O=H?I<D?I-D:I-j:0;return{[h]:d[h]+O,data:{[h]:$,centerOffset:I-$-O,...H&&{alignmentOffset:O}},reset:H}}}),ZL=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:d,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:p=!0,...m}=Qi(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const v=Yr(o),y=gr(a),x=Yr(a)===a,b=await(l.isRTL==null?void 0:l.isRTL(c.floating)),w=d||(x||!p?[Wl(a)]:kL(a)),_=g!=="none";!d&&_&&w.push(...PL(a,p,g,b));const E=[a,...w],R=await dg(t,m),k=[];let M=((r=i.flip)==null?void 0:r.overflows)||[];if(u&&k.push(R[v]),f){const I=RL(o,s,b);k.push(R[I[0]],R[I[1]])}if(M=[...M,{placement:o,overflows:k}],!k.every(I=>I<=0)){var F,D;const I=(((F=i.flip)==null?void 0:F.index)||0)+1,$=E[I];if($&&(!(f==="alignment"?y!==gr($):!1)||M.every(P=>gr(P.placement)===y?P.overflows[0]>0:!0)))return{data:{index:I,overflows:M},reset:{placement:$}};let H=(D=M.filter(O=>O.overflows[0]<=0).sort((O,P)=>O.overflows[1]-P.overflows[1])[0])==null?void 0:D.placement;if(!H)switch(h){case"bestFit":{var j;const O=(j=M.filter(P=>{if(_){const K=gr(P.placement);return K===y||K==="y"}return!0}).map(P=>[P.placement,P.overflows.filter(K=>K>0).reduce((K,G)=>K+G,0)]).sort((P,K)=>P[1]-K[1])[0])==null?void 0:j[0];O&&(H=O);break}case"initialPlacement":H=a;break}if(o!==H)return{reset:{placement:H}}}return{}}}},JL=new Set(["left","top"]);async function QL(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=Yr(n),a=es(n),l=gr(n)==="y",c=JL.has(s)?-1:1,u=i&&l?-1:1,f=Qi(t,e);let{mainAxis:d,crossAxis:h,alignmentAxis:g}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return a&&typeof g=="number"&&(h=a==="end"?g*-1:g),l?{x:h*u,y:d*c}:{x:d*c,y:h*u}}const eF=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:s,middlewareData:a}=t,l=await QL(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:s}}}}},tF=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:a={fn:m=>{let{x:v,y}=m;return{x:v,y}}},...l}=Qi(e,t),c={x:n,y:r},u=await dg(t,l),f=gr(Yr(o)),d=kC(f);let h=c[d],g=c[f];if(i){const m=d==="y"?"top":"left",v=d==="y"?"bottom":"right",y=h+u[m],x=h-u[v];h=wf(y,h,x)}if(s){const m=f==="y"?"top":"left",v=f==="y"?"bottom":"right",y=g+u[m],x=g-u[v];g=wf(y,g,x)}const p=a.fn({...t,[d]:h,[f]:g});return{...p,data:{x:p.x-n,y:p.y-r,enabled:{[d]:i,[f]:s}}}}}},nF=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:s,elements:a}=t,{apply:l=()=>{},...c}=Qi(e,t),u=await dg(t,c),f=Yr(o),d=es(o),h=gr(o)==="y",{width:g,height:p}=i.floating;let m,v;f==="top"||f==="bottom"?(m=f,v=d===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(v=f,m=d==="end"?"top":"bottom");const y=p-u.top-u.bottom,x=g-u.left-u.right,b=qr(p-u[m],y),w=qr(g-u[v],x),_=!t.middlewareData.shift;let E=b,R=w;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(R=x),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(E=y),_&&!d){const M=Xt(u.left,0),F=Xt(u.right,0),D=Xt(u.top,0),j=Xt(u.bottom,0);h?R=g-2*(M!==0||F!==0?M+F:Xt(u.left,u.right)):E=p-2*(D!==0||j!==0?D+j:Xt(u.top,u.bottom))}await l({...t,availableWidth:R,availableHeight:E});const k=await s.getDimensions(a.floating);return g!==k.width||p!==k.height?{reset:{rects:!0}}:{}}}};function MC(e){const t=dn(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=$t(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=Hl(n)!==i||Hl(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function fg(e){return De(e)?e:e.contextElement}function Mi(e){const t=fg(e);if(!$t(t))return Xn(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=MC(t);let s=(i?Hl(n.width):n.width)/r,a=(i?Hl(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const rF=Xn(0);function PC(e){const t=Wt(e);return!bc()||!t.visualViewport?rF:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function oF(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Wt(e)?!1:t}function Vo(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=fg(e);let s=Xn(1);t&&(r?De(r)&&(s=Mi(r)):s=Mi(e));const a=oF(i,n,r)?PC(i):Xn(0);let l=(o.left+a.x)/s.x,c=(o.top+a.y)/s.y,u=o.width/s.x,f=o.height/s.y;if(i){const d=Wt(i),h=r&&De(r)?Wt(r):r;let g=d,p=bf(g);for(;p&&r&&h!==g;){const m=Mi(p),v=p.getBoundingClientRect(),y=dn(p),x=v.left+(p.clientLeft+parseFloat(y.paddingLeft))*m.x,b=v.top+(p.clientTop+parseFloat(y.paddingTop))*m.y;l*=m.x,c*=m.y,u*=m.x,f*=m.y,l+=x,c+=b,g=Wt(p),p=bf(g)}}return Kl({width:u,height:f,x:l,y:c})}function Cc(e,t){const n=wc(e).scrollLeft;return t?t.left+n:Vo(Jn(e)).left+n}function LC(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Cc(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function iF(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",s=Jn(r),a=t?xc(t.floating):!1;if(r===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},c=Xn(1);const u=Xn(0),f=$t(r);if((f||!f&&!i)&&((Ji(r)!=="body"||ga(s))&&(l=wc(r)),$t(r))){const h=Vo(r);c=Mi(r),u.x=h.x+r.clientLeft,u.y=h.y+r.clientTop}const d=s&&!f&&!i?LC(s,l):Xn(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+d.x,y:n.y*c.y-l.scrollTop*c.y+u.y+d.y}}function sF(e){return Array.from(e.getClientRects())}function aF(e){const t=Jn(e),n=wc(e),r=e.ownerDocument.body,o=Xt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Xt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+Cc(e);const a=-n.scrollTop;return dn(r).direction==="rtl"&&(s+=Xt(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}const qv=25;function lF(e,t){const n=Wt(e),r=Jn(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const u=bc();(!u||u&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}const c=Cc(r);if(c<=0){const u=r.ownerDocument,f=u.body,d=getComputedStyle(f),h=u.compatMode==="CSS1Compat"&&parseFloat(d.marginLeft)+parseFloat(d.marginRight)||0,g=Math.abs(r.clientWidth-f.clientWidth-h);g<=qv&&(i-=g)}else c<=qv&&(i+=c);return{width:i,height:s,x:a,y:l}}const cF=new Set(["absolute","fixed"]);function uF(e,t){const n=Vo(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=$t(e)?Mi(e):Xn(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,l=o*i.x,c=r*i.y;return{width:s,height:a,x:l,y:c}}function Yv(e,t,n){let r;if(t==="viewport")r=lF(e,n);else if(t==="document")r=aF(Jn(e));else if(De(t))r=uF(t,n);else{const o=PC(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Kl(r)}function FC(e,t){const n=wr(e);return n===t||!De(n)||mr(n)?!1:dn(n).position==="fixed"||FC(n,t)}function dF(e,t){const n=t.get(e);if(n)return n;let r=Dr(e,[],!1).filter(a=>De(a)&&Ji(a)!=="body"),o=null;const i=dn(e).position==="fixed";let s=i?wr(e):e;for(;De(s)&&!mr(s);){const a=dn(s),l=lg(s);!l&&a.position==="fixed"&&(o=null),(i?!l&&!o:!l&&a.position==="static"&&!!o&&cF.has(o.position)||ga(s)&&!l&&FC(e,s))?r=r.filter(u=>u!==s):o=a,s=wr(s)}return t.set(e,r),r}function fF(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?xc(t)?[]:dF(t,this._c):[].concat(n),r],a=s[0],l=s.reduce((c,u)=>{const f=Yv(t,u,o);return c.top=Xt(f.top,c.top),c.right=qr(f.right,c.right),c.bottom=qr(f.bottom,c.bottom),c.left=Xt(f.left,c.left),c},Yv(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function hF(e){const{width:t,height:n}=MC(e);return{width:t,height:n}}function gF(e,t,n){const r=$t(t),o=Jn(t),i=n==="fixed",s=Vo(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=Xn(0);function c(){l.x=Cc(o)}if(r||!r&&!i)if((Ji(t)!=="body"||ga(o))&&(a=wc(t)),r){const h=Vo(t,!0,i,t);l.x=h.x+t.clientLeft,l.y=h.y+t.clientTop}else o&&c();i&&!r&&o&&c();const u=o&&!r&&!i?LC(o,a):Xn(0),f=s.left+a.scrollLeft-l.x-u.x,d=s.top+a.scrollTop-l.y-u.y;return{x:f,y:d,width:s.width,height:s.height}}function Du(e){return dn(e).position==="static"}function Xv(e,t){if(!$t(e)||dn(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Jn(e)===n&&(n=n.ownerDocument.body),n}function $C(e,t){const n=Wt(e);if(xc(e))return n;if(!$t(e)){let o=wr(e);for(;o&&!mr(o);){if(De(o)&&!Du(o))return o;o=wr(o)}return n}let r=Xv(e,t);for(;r&&yL(r)&&Du(r);)r=Xv(r,t);return r&&mr(r)&&Du(r)&&!lg(r)?n:r||CL(e)||n}const pF=async function(e){const t=this.getOffsetParent||$C,n=this.getDimensions,r=await n(e.floating);return{reference:gF(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function mF(e){return dn(e).direction==="rtl"}const yF={convertOffsetParentRelativeRectToViewportRelativeRect:iF,getDocumentElement:Jn,getClippingRect:fF,getOffsetParent:$C,getElementRects:pF,getClientRects:sF,getDimensions:hF,getScale:Mi,isElement:De,isRTL:mF};function OC(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function vF(e,t){let n=null,r;const o=Jn(e);function i(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),i();const c=e.getBoundingClientRect(),{left:u,top:f,width:d,height:h}=c;if(a||t(),!d||!h)return;const g=Wa(f),p=Wa(o.clientWidth-(u+d)),m=Wa(o.clientHeight-(f+h)),v=Wa(u),x={rootMargin:-g+"px "+-p+"px "+-m+"px "+-v+"px",threshold:Xt(0,qr(1,l))||1};let b=!0;function w(_){const E=_[0].intersectionRatio;if(E!==l){if(!b)return s();E?s(!1,E):r=setTimeout(()=>{s(!1,1e-7)},1e3)}E===1&&!OC(c,e.getBoundingClientRect())&&s(),b=!1}try{n=new IntersectionObserver(w,{...x,root:o.ownerDocument})}catch{n=new IntersectionObserver(w,x)}n.observe(e)}return s(!0),i}function hg(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=fg(e),u=o||i?[...c?Dr(c):[],...Dr(t)]:[];u.forEach(v=>{o&&v.addEventListener("scroll",n,{passive:!0}),i&&v.addEventListener("resize",n)});const f=c&&a?vF(c,n):null;let d=-1,h=null;s&&(h=new ResizeObserver(v=>{let[y]=v;y&&y.target===c&&h&&(h.unobserve(t),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var x;(x=h)==null||x.observe(t)})),n()}),c&&!l&&h.observe(c),h.observe(t));let g,p=l?Vo(e):null;l&&m();function m(){const v=Vo(e);p&&!OC(p,v)&&n(),p=v,g=requestAnimationFrame(m)}return n(),()=>{var v;u.forEach(y=>{o&&y.removeEventListener("scroll",n),i&&y.removeEventListener("resize",n)}),f?.(),(v=h)==null||v.disconnect(),h=null,l&&cancelAnimationFrame(g)}}const xF=eF,bF=tF,wF=ZL,CF=nF,Zv=XL,SF=(e,t,n)=>{const r=new Map,o={platform:yF,...n},i={...o.platform,_c:r};return YL(e,t,{...o,platform:i})};var _F=typeof document<"u",TF=function(){},ul=_F?S.useLayoutEffect:TF;function Ul(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Ul(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const i=o[r];if(!(i==="_owner"&&e.$$typeof)&&!Ul(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function IC(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Jv(e,t){const n=IC(e);return Math.round(t*n)/n}function ju(e){const t=N.useRef(e);return ul(()=>{t.current=e}),t}function EF(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:s}={},transform:a=!0,whileElementsMounted:l,open:c}=e,[u,f]=N.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[d,h]=N.useState(r);Ul(d,r)||h(r);const[g,p]=N.useState(null),[m,v]=N.useState(null),y=N.useCallback(P=>{P!==_.current&&(_.current=P,p(P))},[]),x=N.useCallback(P=>{P!==E.current&&(E.current=P,v(P))},[]),b=i||g,w=s||m,_=N.useRef(null),E=N.useRef(null),R=N.useRef(u),k=l!=null,M=ju(l),F=ju(o),D=ju(c),j=N.useCallback(()=>{if(!_.current||!E.current)return;const P={placement:t,strategy:n,middleware:d};F.current&&(P.platform=F.current),SF(_.current,E.current,P).then(K=>{const G={...K,isPositioned:D.current!==!1};I.current&&!Ul(R.current,G)&&(R.current=G,k_.flushSync(()=>{f(G)}))})},[d,t,n,F,D]);ul(()=>{c===!1&&R.current.isPositioned&&(R.current.isPositioned=!1,f(P=>({...P,isPositioned:!1})))},[c]);const I=N.useRef(!1);ul(()=>(I.current=!0,()=>{I.current=!1}),[]),ul(()=>{if(b&&(_.current=b),w&&(E.current=w),b&&w){if(M.current)return M.current(b,w,j);j()}},[b,w,j,M,k]);const $=N.useMemo(()=>({reference:_,floating:E,setReference:y,setFloating:x}),[y,x]),H=N.useMemo(()=>({reference:b,floating:w}),[b,w]),O=N.useMemo(()=>{const P={position:n,left:0,top:0};if(!H.floating)return P;const K=Jv(H.floating,u.x),G=Jv(H.floating,u.y);return a?{...P,transform:"translate("+K+"px, "+G+"px)",...IC(H.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:K,top:G}},[n,a,H.floating,u.x,u.y]);return N.useMemo(()=>({...u,update:j,refs:$,elements:H,floatingStyles:O}),[u,j,$,H,O])}const RF=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?Zv({element:r.current,padding:o}).fn(n):{}:r?Zv({element:r,padding:o}).fn(n):{}}}},gg=(e,t)=>({...xF(e),options:[e,t]}),pg=(e,t)=>({...bF(e),options:[e,t]}),mg=(e,t)=>({...wF(e),options:[e,t]}),kF=(e,t)=>({...CF(e),options:[e,t]}),AF=(e,t)=>({...RF(e),options:[e,t]});function DC(e){const t=N.useRef(void 0),n=N.useCallback(r=>{const o=e.map(i=>{if(i!=null){if(typeof i=="function"){const s=i,a=s(r);return typeof a=="function"?a:()=>{s(null)}}return i.current=r,()=>{i.current=null}}});return()=>{o.forEach(i=>i?.())}},e);return N.useMemo(()=>e.every(r=>r==null)?null:r=>{t.current&&(t.current(),t.current=void 0),r!=null&&(t.current=n(r))},e)}const NF="data-floating-ui-focusable",Qv="active",e0="selected",MF={...N};let t0=!1,PF=0;const n0=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+PF++;function LF(){const[e,t]=N.useState(()=>t0?n0():void 0);return Vi(()=>{e==null&&t(n0())},[]),N.useEffect(()=>{t0=!0},[]),e}const FF=MF.useId,jC=FF||LF;let Sf;process.env.NODE_ENV!=="production"&&(Sf=new Set);function $F(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");if(!((e=Sf)!=null&&e.has(o))){var i;(i=Sf)==null||i.add(o),console.error(o)}}function OF(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(o=>o(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;(r=e.get(t))==null||r.delete(n)}}}const IF=N.createContext(null),DF=N.createContext(null),yg=()=>{var e;return((e=N.useContext(IF))==null?void 0:e.id)||null},vg=()=>N.useContext(DF);function xg(e){return"data-floating-ui-"+e}function on(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}const r0=xg("safe-polygon");function Vu(e,t,n){if(n&&!qs(n))return 0;if(typeof e=="number")return e;if(typeof e=="function"){const r=e();return typeof r=="number"?r:r?.[t]}return e?.[t]}function Bu(e){return typeof e=="function"?e():e}function VC(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:o,events:i,elements:s}=e,{enabled:a=!0,delay:l=0,handleClose:c=null,mouseOnly:u=!1,restMs:f=0,move:d=!0}=t,h=vg(),g=yg(),p=Ka(c),m=Ka(l),v=Ka(n),y=Ka(f),x=N.useRef(),b=N.useRef(-1),w=N.useRef(),_=N.useRef(-1),E=N.useRef(!0),R=N.useRef(!1),k=N.useRef(()=>{}),M=N.useRef(!1),F=Vn(()=>{var O;const P=(O=o.current.openEvent)==null?void 0:O.type;return P?.includes("mouse")&&P!=="mousedown"});N.useEffect(()=>{if(!a)return;function O(P){let{open:K}=P;K||(on(b),on(_),E.current=!0,M.current=!1)}return i.on("openchange",O),()=>{i.off("openchange",O)}},[a,i]),N.useEffect(()=>{if(!a||!p.current||!n)return;function O(K){F()&&r(!1,K,"hover")}const P=Co(s.floating).documentElement;return P.addEventListener("mouseleave",O),()=>{P.removeEventListener("mouseleave",O)}},[s.floating,n,r,a,p,F]);const D=N.useCallback(function(O,P,K){P===void 0&&(P=!0),K===void 0&&(K="hover");const G=Vu(m.current,"close",x.current);G&&!w.current?(on(b),b.current=window.setTimeout(()=>r(!1,O,K),G)):P&&(on(b),r(!1,O,K))},[m,r]),j=Vn(()=>{k.current(),w.current=void 0}),I=Vn(()=>{if(R.current){const O=Co(s.floating).body;O.style.pointerEvents="",O.removeAttribute(r0),R.current=!1}}),$=Vn(()=>o.current.openEvent?["click","mousedown"].includes(o.current.openEvent.type):!1);N.useEffect(()=>{if(!a)return;function O(U){if(on(b),E.current=!1,u&&!qs(x.current)||Bu(y.current)>0&&!Vu(m.current,"open"))return;const Z=Vu(m.current,"open",x.current);Z?b.current=window.setTimeout(()=>{v.current||r(!0,U,"hover")},Z):n||r(!0,U,"hover")}function P(U){if($()){I();return}k.current();const Z=Co(s.floating);if(on(_),M.current=!1,p.current&&o.current.floatingContext){n||on(b),w.current=p.current({...o.current.floatingContext,tree:h,x:U.clientX,y:U.clientY,onClose(){I(),j(),$()||D(U,!0,"safe-polygon")}});const ne=w.current;Z.addEventListener("mousemove",ne),k.current=()=>{Z.removeEventListener("mousemove",ne)};return}(x.current!=="touch"||!Gs(s.floating,U.relatedTarget))&&D(U)}function K(U){$()||o.current.floatingContext&&(p.current==null||p.current({...o.current.floatingContext,tree:h,x:U.clientX,y:U.clientY,onClose(){I(),j(),$()||D(U)}})(U))}function G(){on(b)}function re(U){$()||D(U,!1)}if(De(s.domReference)){const U=s.domReference,Z=s.floating;return n&&U.addEventListener("mouseleave",K),d&&U.addEventListener("mousemove",O,{once:!0}),U.addEventListener("mouseenter",O),U.addEventListener("mouseleave",P),Z&&(Z.addEventListener("mouseleave",K),Z.addEventListener("mouseenter",G),Z.addEventListener("mouseleave",re)),()=>{n&&U.removeEventListener("mouseleave",K),d&&U.removeEventListener("mousemove",O),U.removeEventListener("mouseenter",O),U.removeEventListener("mouseleave",P),Z&&(Z.removeEventListener("mouseleave",K),Z.removeEventListener("mouseenter",G),Z.removeEventListener("mouseleave",re))}}},[s,a,e,u,d,D,j,I,r,n,v,h,m,p,o,$,y]),Vi(()=>{var O;if(a&&n&&(O=p.current)!=null&&(O=O.__options)!=null&&O.blockPointerEvents&&F()){R.current=!0;const K=s.floating;if(De(s.domReference)&&K){var P;const G=Co(s.floating).body;G.setAttribute(r0,"");const re=s.domReference,U=h==null||(P=h.nodesRef.current.find(Z=>Z.id===g))==null||(P=P.context)==null?void 0:P.elements.floating;return U&&(U.style.pointerEvents=""),G.style.pointerEvents="none",re.style.pointerEvents="auto",K.style.pointerEvents="auto",()=>{G.style.pointerEvents="",re.style.pointerEvents="",K.style.pointerEvents=""}}}},[a,n,g,s,h,p,F]),Vi(()=>{n||(x.current=void 0,M.current=!1,j(),I())},[n,j,I]),N.useEffect(()=>()=>{j(),on(b),on(_),I()},[a,s.domReference,j,I]);const H=N.useMemo(()=>{function O(P){x.current=P.pointerType}return{onPointerDown:O,onPointerEnter:O,onMouseMove(P){const{nativeEvent:K}=P;function G(){!E.current&&!v.current&&r(!0,K,"hover")}u&&!qs(x.current)||n||Bu(y.current)===0||M.current&&P.movementX**2+P.movementY**2<2||(on(_),x.current==="touch"?G():(M.current=!0,_.current=window.setTimeout(G,Bu(y.current))))}}},[u,r,n,v,y]);return N.useMemo(()=>a?{reference:H}:{},[a,H])}function o0(e){return $t(e.target)&&e.target.tagName==="BUTTON"}function jF(e){return $t(e.target)&&e.target.tagName==="A"}function i0(e){return NC(e)}function VF(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:o,elements:{domReference:i}}=e,{enabled:s=!0,event:a="click",toggle:l=!0,ignoreMouse:c=!1,keyboardHandlers:u=!0,stickIfOpen:f=!0}=t,d=N.useRef(),h=N.useRef(!1),g=N.useMemo(()=>({onPointerDown(p){d.current=p.pointerType},onMouseDown(p){const m=d.current;p.button===0&&a!=="click"&&(qs(m,!0)&&c||(n&&l&&(!(o.current.openEvent&&f)||o.current.openEvent.type==="mousedown")?r(!1,p.nativeEvent,"click"):(p.preventDefault(),r(!0,p.nativeEvent,"click"))))},onClick(p){const m=d.current;if(a==="mousedown"&&d.current){d.current=void 0;return}qs(m,!0)&&c||(n&&l&&(!(o.current.openEvent&&f)||o.current.openEvent.type==="click")?r(!1,p.nativeEvent,"click"):r(!0,p.nativeEvent,"click"))},onKeyDown(p){d.current=void 0,!(p.defaultPrevented||!u||o0(p))&&(p.key===" "&&!i0(i)&&(p.preventDefault(),h.current=!0),!jF(p)&&p.key==="Enter"&&r(!(n&&l),p.nativeEvent,"click"))},onKeyUp(p){p.defaultPrevented||!u||o0(p)||i0(i)||p.key===" "&&h.current&&(h.current=!1,r(!(n&&l),p.nativeEvent,"click"))}}),[o,i,a,c,u,r,n,f,l]);return N.useMemo(()=>s?{reference:g}:{},[s,g])}const BF={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},zF={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},s0=e=>{var t,n;return{escapeKey:typeof e=="boolean"?e:(t=e?.escapeKey)!=null?t:!1,outsidePress:typeof e=="boolean"?e:(n=e?.outsidePress)!=null?n:!0}};function BC(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,elements:o,dataRef:i}=e,{enabled:s=!0,escapeKey:a=!0,outsidePress:l=!0,outsidePressEvent:c="pointerdown",referencePress:u=!1,referencePressEvent:f="pointerdown",ancestorScroll:d=!1,bubbles:h,capture:g}=t,p=vg(),m=Vn(typeof l=="function"?l:()=>!1),v=typeof l=="function"?m:l,y=N.useRef(!1),{escapeKey:x,outsidePress:b}=s0(h),{escapeKey:w,outsidePress:_}=s0(g),E=N.useRef(!1),R=Vn(I=>{var $;if(!n||!s||!a||I.key!=="Escape"||E.current)return;const H=($=i.current.floatingContext)==null?void 0:$.nodeId,O=p?cl(p.nodesRef.current,H):[];if(!x&&(I.stopPropagation(),O.length>0)){let P=!0;if(O.forEach(K=>{var G;if((G=K.context)!=null&&G.open&&!K.context.dataRef.current.__escapeKeyBubbles){P=!1;return}}),!P)return}r(!1,HL(I)?I.nativeEvent:I,"escape-key")}),k=Vn(I=>{var $;const H=()=>{var O;R(I),(O=hi(I))==null||O.removeEventListener("keydown",H)};($=hi(I))==null||$.addEventListener("keydown",H)}),M=Vn(I=>{var $;const H=i.current.insideReactTree;i.current.insideReactTree=!1;const O=y.current;if(y.current=!1,c==="click"&&O||H||typeof v=="function"&&!v(I))return;const P=hi(I),K="["+xg("inert")+"]",G=Co(o.floating).querySelectorAll(K);let re=De(P)?P:null;for(;re&&!mr(re);){const ne=wr(re);if(mr(ne)||!De(ne))break;re=ne}if(G.length&&De(P)&&!VL(P)&&!Gs(P,o.floating)&&Array.from(G).every(ne=>!Gs(re,ne)))return;if($t(P)&&j){const ne=mr(P),oe=dn(P),me=/auto|scroll/,ee=ne||me.test(oe.overflowX),xe=ne||me.test(oe.overflowY),Se=ee&&P.clientWidth>0&&P.scrollWidth>P.clientWidth,Ee=xe&&P.clientHeight>0&&P.scrollHeight>P.clientHeight,ze=oe.direction==="rtl",je=Ee&&(ze?I.offsetX<=P.offsetWidth-P.clientWidth:I.offsetX>P.clientWidth),Rt=Se&&I.offsetY>P.clientHeight;if(je||Rt)return}const U=($=i.current.floatingContext)==null?void 0:$.nodeId,Z=p&&cl(p.nodesRef.current,U).some(ne=>{var oe;return Iu(I,(oe=ne.context)==null?void 0:oe.elements.floating)});if(Iu(I,o.floating)||Iu(I,o.domReference)||Z)return;const Q=p?cl(p.nodesRef.current,U):[];if(Q.length>0){let ne=!0;if(Q.forEach(oe=>{var me;if((me=oe.context)!=null&&me.open&&!oe.context.dataRef.current.__outsidePressBubbles){ne=!1;return}}),!ne)return}r(!1,I,"outside-press")}),F=Vn(I=>{var $;const H=()=>{var O;M(I),(O=hi(I))==null||O.removeEventListener(c,H)};($=hi(I))==null||$.addEventListener(c,H)});N.useEffect(()=>{if(!n||!s)return;i.current.__escapeKeyBubbles=x,i.current.__outsidePressBubbles=b;let I=-1;function $(G){r(!1,G,"ancestor-scroll")}function H(){window.clearTimeout(I),E.current=!0}function O(){I=window.setTimeout(()=>{E.current=!1},bc()?5:0)}const P=Co(o.floating);a&&(P.addEventListener("keydown",w?k:R,w),P.addEventListener("compositionstart",H),P.addEventListener("compositionend",O)),v&&P.addEventListener(c,_?F:M,_);let K=[];return d&&(De(o.domReference)&&(K=Dr(o.domReference)),De(o.floating)&&(K=K.concat(Dr(o.floating))),!De(o.reference)&&o.reference&&o.reference.contextElement&&(K=K.concat(Dr(o.reference.contextElement)))),K=K.filter(G=>{var re;return G!==((re=P.defaultView)==null?void 0:re.visualViewport)}),K.forEach(G=>{G.addEventListener("scroll",$,{passive:!0})}),()=>{a&&(P.removeEventListener("keydown",w?k:R,w),P.removeEventListener("compositionstart",H),P.removeEventListener("compositionend",O)),v&&P.removeEventListener(c,_?F:M,_),K.forEach(G=>{G.removeEventListener("scroll",$)}),window.clearTimeout(I)}},[i,o,a,v,c,n,r,d,s,x,b,R,w,k,M,_,F]),N.useEffect(()=>{i.current.insideReactTree=!1},[i,v,c]);const D=N.useMemo(()=>({onKeyDown:R,...u&&{[BF[f]]:I=>{r(!1,I.nativeEvent,"reference-press")},...f!=="click"&&{onClick(I){r(!1,I.nativeEvent,"reference-press")}}}}),[R,r,u,f]),j=N.useMemo(()=>({onKeyDown:R,onMouseDown(){y.current=!0},onMouseUp(){y.current=!0},[zF[c]]:()=>{i.current.insideReactTree=!0}}),[R,c,i]);return N.useMemo(()=>s?{reference:D,floating:j}:{},[s,D,j])}function HF(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=jC(),i=N.useRef({}),[s]=N.useState(()=>OF()),a=yg()!=null;if(process.env.NODE_ENV!=="production"){const h=r.reference;h&&!De(h)&&$F("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[l,c]=N.useState(r.reference),u=Vn((h,g,p)=>{i.current.openEvent=h?g:void 0,s.emit("openchange",{open:h,event:g,reason:p,nested:a}),n?.(h,g,p)}),f=N.useMemo(()=>({setPositionReference:c}),[]),d=N.useMemo(()=>({reference:l||r.reference||null,floating:r.floating||null,domReference:r.reference}),[l,r.reference,r.floating]);return N.useMemo(()=>({dataRef:i,open:t,onOpenChange:u,elements:d,events:s,floatingId:o,refs:f}),[t,u,d,s,o,f])}function bg(e){e===void 0&&(e={});const{nodeId:t}=e,n=HF({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[i,s]=N.useState(null),[a,l]=N.useState(null),u=o?.domReference||i,f=N.useRef(null),d=vg();Vi(()=>{u&&(f.current=u)},[u]);const h=EF({...e,elements:{...o,...a&&{reference:a}}}),g=N.useCallback(x=>{const b=De(x)?{getBoundingClientRect:()=>x.getBoundingClientRect(),getClientRects:()=>x.getClientRects(),contextElement:x}:x;l(b),h.refs.setReference(b)},[h.refs]),p=N.useCallback(x=>{(De(x)||x===null)&&(f.current=x,s(x)),(De(h.refs.reference.current)||h.refs.reference.current===null||x!==null&&!De(x))&&h.refs.setReference(x)},[h.refs]),m=N.useMemo(()=>({...h.refs,setReference:p,setPositionReference:g,domReference:f}),[h.refs,p,g]),v=N.useMemo(()=>({...h.elements,domReference:u}),[h.elements,u]),y=N.useMemo(()=>({...h,...r,refs:m,elements:v,nodeId:t}),[h,m,v,t,r]);return Vi(()=>{r.dataRef.current.floatingContext=y;const x=d?.nodesRef.current.find(b=>b.id===t);x&&(x.context=y)}),N.useMemo(()=>({...h,context:y,refs:m,elements:v}),[h,m,v,y])}function zu(){return IL()&&OL()}function WF(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,events:o,dataRef:i,elements:s}=e,{enabled:a=!0,visibleOnly:l=!0}=t,c=N.useRef(!1),u=N.useRef(-1),f=N.useRef(!0);N.useEffect(()=>{if(!a)return;const h=Wt(s.domReference);function g(){!n&&$t(s.domReference)&&s.domReference===Uv(Co(s.domReference))&&(c.current=!0)}function p(){f.current=!0}function m(){f.current=!1}return h.addEventListener("blur",g),zu()&&(h.addEventListener("keydown",p,!0),h.addEventListener("pointerdown",m,!0)),()=>{h.removeEventListener("blur",g),zu()&&(h.removeEventListener("keydown",p,!0),h.removeEventListener("pointerdown",m,!0))}},[s.domReference,n,a]),N.useEffect(()=>{if(!a)return;function h(g){let{reason:p}=g;(p==="reference-press"||p==="escape-key")&&(c.current=!0)}return o.on("openchange",h),()=>{o.off("openchange",h)}},[o,a]),N.useEffect(()=>()=>{on(u)},[]);const d=N.useMemo(()=>({onMouseLeave(){c.current=!1},onFocus(h){if(c.current)return;const g=hi(h.nativeEvent);if(l&&De(g)){if(zu()&&!h.relatedTarget){if(!f.current&&!NC(g))return}else if(!BL(g))return}r(!0,h.nativeEvent,"focus")},onBlur(h){c.current=!1;const g=h.relatedTarget,p=h.nativeEvent,m=De(g)&&g.hasAttribute(xg("focus-guard"))&&g.getAttribute("data-type")==="outside";u.current=window.setTimeout(()=>{var v;const y=Uv(s.domReference?s.domReference.ownerDocument:document);!g&&y===s.domReference||Gs((v=i.current.floatingContext)==null?void 0:v.refs.floating.current,y)||Gs(s.domReference,y)||m||r(!1,p,"focus")})}}),[i,s.domReference,r,l]);return N.useMemo(()=>a?{reference:d}:{},[a,d])}function Hu(e,t,n){const r=new Map,o=n==="item";let i=e;if(o&&e){const{[Qv]:s,[e0]:a,...l}=e;i=l}return{...n==="floating"&&{tabIndex:-1,[NF]:""},...i,...t.map(s=>{const a=s?s[n]:null;return typeof a=="function"?e?a(e):null:a}).concat(e).reduce((s,a)=>(a&&Object.entries(a).forEach(l=>{let[c,u]=l;if(!(o&&[Qv,e0].includes(c)))if(c.indexOf("on")===0){if(r.has(c)||r.set(c,[]),typeof u=="function"){var f;(f=r.get(c))==null||f.push(u),s[c]=function(){for(var d,h=arguments.length,g=new Array(h),p=0;p<h;p++)g[p]=arguments[p];return(d=r.get(c))==null?void 0:d.map(m=>m(...g)).find(m=>m!==void 0)}}}else s[c]=u}),s),{})}}function zC(e){e===void 0&&(e=[]);const t=e.map(a=>a?.reference),n=e.map(a=>a?.floating),r=e.map(a=>a?.item),o=N.useCallback(a=>Hu(a,e,"reference"),t),i=N.useCallback(a=>Hu(a,e,"floating"),n),s=N.useCallback(a=>Hu(a,e,"item"),r);return N.useMemo(()=>({getReferenceProps:o,getFloatingProps:i,getItemProps:s}),[o,i,s])}const KF=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function HC(e,t){var n,r;t===void 0&&(t={});const{open:o,elements:i,floatingId:s}=e,{enabled:a=!0,role:l="dialog"}=t,c=jC(),u=((n=i.domReference)==null?void 0:n.id)||c,f=N.useMemo(()=>{var y;return((y=zL(i.floating))==null?void 0:y.id)||s},[i.floating,s]),d=(r=KF.get(l))!=null?r:l,g=yg()!=null,p=N.useMemo(()=>d==="tooltip"||l==="label"?{["aria-"+(l==="label"?"labelledby":"describedby")]:o?f:void 0}:{"aria-expanded":o?"true":"false","aria-haspopup":d==="alertdialog"?"dialog":d,"aria-controls":o?f:void 0,...d==="listbox"&&{role:"combobox"},...d==="menu"&&{id:u},...d==="menu"&&g&&{role:"menuitem"},...l==="select"&&{"aria-autocomplete":"none"},...l==="combobox"&&{"aria-autocomplete":"list"}},[d,f,g,o,u,l]),m=N.useMemo(()=>{const y={id:f,...d&&{role:d}};return d==="tooltip"||l==="label"?y:{...y,...d==="menu"&&{"aria-labelledby":u}}},[d,f,u,l]),v=N.useCallback(y=>{let{active:x,selected:b}=y;const w={role:"option",...x&&{id:f+"-fui-option"}};switch(l){case"select":case"combobox":return{...w,"aria-selected":b}}return{}},[f,l]);return N.useMemo(()=>a?{reference:p,floating:m,item:v}:{},[a,p,m,v])}const UF=e=>N.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M6 9L12 15L18 9",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),GF=e=>N.createElement("svg",{fill:"currentColor",id:"Capa_1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0 0 462.035 462.035",xmlSpace:"preserve",...e},N.createElement("g",null,N.createElement("path",{d:"M457.83,158.441c-0.021-0.028-0.033-0.058-0.057-0.087l-50.184-62.48c-0.564-0.701-1.201-1.305-1.879-1.845 c-2.16-2.562-5.355-4.225-8.967-4.225H65.292c-3.615,0-6.804,1.661-8.965,4.225c-0.678,0.54-1.316,1.138-1.885,1.845l-50.178,62.48 c-0.023,0.029-0.034,0.059-0.057,0.087C1.655,160.602,0,163.787,0,167.39v193.07c0,6.5,5.27,11.771,11.77,11.771h438.496 c6.5,0,11.77-5.271,11.77-11.771V167.39C462.037,163.787,460.381,160.602,457.83,158.441z M408.516,134.615l16.873,21.005h-16.873 V134.615z M384.975,113.345v42.274H296.84c-2.514,0-4.955,0.805-6.979,2.293l-58.837,43.299l-58.849-43.305 c-2.023-1.482-4.466-2.287-6.978-2.287H77.061v-42.274H384.975z M53.523,155.62H36.65l16.873-21.005V155.62z M438.498,348.69H23.54 V179.16h137.796l62.711,46.148c4.15,3.046,9.805,3.052,13.954-0.005l62.698-46.144h137.799V348.69L438.498,348.69z"}))),WC=e=>N.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("g",{opacity:.6},N.createElement("path",{d:"M12 4L4 12M4 4L12 12",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}))),{color:tn,cornerRadius:qF,spacing:gi}=V,Wu={sm:{h:28,p:`${gi.xs} ${gi.sm}`,text:"body-2"},md:{h:32,p:`6px ${gi.md}`,text:"body-2"},lg:{h:40,p:`${gi.sm} ${gi.lg}`,text:"body-1"}},wg=S.forwardRef(({label:e,color:t="primary",size:n="md",onClick:r,onDelete:o,avatar:i,icon:s,disabled:a,className:l,labelClassName:c,avatarClassName:u,iconClassName:f,deleteButtonClassName:d},h)=>{const g=S.useRef(null),p=S.useMemo(()=>{switch(t){case"primary":return{bg:tn.status.neutralTintLow,color:tn.text.primary};case"accent":return{bg:tn.status.accentTintLow,color:tn.text.accent};case"warning":return{bg:tn.status.warningTintLow,color:tn.text.warning};case"positive":return{bg:tn.status.positiveTintLow,color:tn.text.positive};case"negative":return{bg:tn.status.negativeTintLow,color:tn.text.negative};case"transfer":return{bg:"var(--status-transfer-tint-low)",color:"var(--text-transfer)"};default:return{bg:tn.status.neutralTintLow,color:tn.text.primary}}},[t]),m=T.css({cursor:a?"not-allowed":r?"pointer":"default",opacity:a?.5:1,userSelect:"none",position:"relative",transition:"background-color 0.2s, opacity 0.2s","&:hover":a?void 0:{backgroundColor:p.bg}}),v=T.css({display:"inline-flex",cursor:"pointer",opacity:.6,"&:hover":{opacity:1}});return C.jsxs(q,{ref:y=>{g.current=y,typeof h=="function"?h(y):h&&(h.current=y)},row:!0,alignItems:"center",justifyContent:"center",gap:gi.sm,h:Wu[n].h,p:Wu[n].p,overflow:"hidden",borderRadius:qF.sm,backgroundColor:p.bg,color:p.color,onClick:r,className:T.cx(m,l),children:[r&&C.jsx(zo,{}),i&&C.jsx(q,{w:20,h:20,borderRadius:"50%",overflow:"hidden",className:u,children:i}),s&&C.jsx(q,{className:f,children:s}),typeof e=="string"?C.jsx(le,{variant:Wu[n].text,colorName:t,textOverflow:"ellipsis",overflow:"hidden",className:c,children:e}):e,o&&!a&&C.jsx(le,{className:T.cx(v,d),colorName:t,onClick:y=>{y.stopPropagation(),o(y)},children:C.jsx(WC,{})})]})});wg.displayName="Tag";const{color:At,cornerRadius:ps}=V,a0=T.css({borderColor:At.border.negativePrimary}),Ku=T.css({cursor:"not-allowed",opacity:.5}),KC=T.css({display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"none",color:"#9ca3af","& svg":{width:20,height:20,transition:"transform 0.2s ease-in"}}),YF=T.css({[`& .${KC} svg`]:{transform:"rotateX(180deg)"}}),dt={"select-container":T.css({position:"relative",display:"inline-block",minWidth:120,"&.full-width":{width:"100%"}}),"full-width":T.css({width:"100%"}),"select-input":T.css({border:`1px solid ${At.border.neutralAlphaBasic}`,borderRadius:ps.md,cursor:"pointer",transition:"all 0.2s ease-in-out",boxSizing:"border-box",[`&:hover:not(.${Ku})`]:{borderColor:At.border.neutralAlphaHigh,backgroundColor:At.fill.neutralPrimaryHover},[`&:focus:not(.${Ku})`]:{outline:"none",borderColor:At.border.accentPrimary},[`&.${a0}:focus`]:{boxShadow:`0 0 0 3px ${At.effect.shadowS}`}}),"size-xs":T.css({minHeight:32,padding:"8px 8px 8px 12px",borderRadius:ps.sm}),"size-sm":T.css({minHeight:40,padding:"10px 12px 10px 16px",borderRadius:ps.sm}),"size-md":T.css({minHeight:48,padding:"14px 12px 14px 16px",borderRadius:ps.md}),"background-primary":T.css({backgroundColor:At.fill.bgPrimary}),"background-secondary":T.css({backgroundColor:At.fill.bgSecondary}),error:a0,disabled:Ku,open:YF,"select-value":T.css({flex:1,color:At.text.primary,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",alignSelf:"center",...ye.common,...ye.body2}),"select-value_xs":T.css({...ye.common,...ye.caption1}),hidden:T.css({visibility:"hidden"}),visible:T.css({visibility:"visible"}),"select-arrow":KC,"select-dropdown":T.css({marginTop:4,backgroundColor:At.fill.bgPrimary,borderRadius:ps.md,boxShadow:`0 4px 20px 0 ${At.effect.shadowS}`,maxHeight:224,overflow:"hidden"}),"select-menu":T.css({maxHeight:224,overflowY:"auto",padding:"4px 0","&::-webkit-scrollbar":{width:3},"&::-webkit-scrollbar-track":{background:"#f1f1f1"},"&::-webkit-scrollbar-thumb":{background:"#c1c1c1",borderRadius:3,"&:hover":{background:At.fill.neutralSecondary}}}),"select-menu-item":T.css({cursor:"pointer",transition:"background-color 0.15s ease-in-out",color:At.text.primary,padding:10,overflow:"hidden",textOverflow:"ellipsis","&:hover":{backgroundColor:At.fill.neutralSecondaryHover}}),"select-menu-item-first":T.css({"&:hover":{cursor:"auto",backgroundColor:"inherit"}}),selected:T.css({backgroundColor:At.fill.neutralSecondary}),"overflow-tooltip-container":T.css({width:"100%",position:"relative"}),"overflow-tooltip-text":T.css({width:"100%",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}),"empty-block":T.css({textAlign:"center",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",padding:14})},XF={xs:T.css({width:16,height:16,"& svg":{width:16,height:16,transition:"transform 0.2s ease-in"}}),sm:T.css({}),md:T.css({})};function Cg({value:e,onChange:t,multiple:n=!1,returnedValue:r,renderItem:o,renderInputItem:i,renderSingleInputItem:s,renderMultipleInputItem:a,renderDropdownItem:l,placeholder:c,items:u=[],fullWidth:f,size:d="md",showDefaultItem:h,disabled:g,label:p,firstItem:m,lastItem:v,observer:y,emptyText:x,onBlur:b,prompt:w,error:_,errorText:E,dropdownMaxWidth:R=400,dropdownMinWidth:k=120,minWidth:M=120,width:F,background:D="secondary",dropdownClassName:j,className:I,triggerClassName:$,menuClassName:H,itemClassName:O,labelClassName:P,promptClassName:K,errorClassName:G}){const[re,U]=Bo(e,n?[]:null),[Z,Q]=S.useState(!1),{refs:ne,floatingStyles:oe}=bg({open:Z,strategy:"fixed",middleware:[gg(4),mg({crossAxis:!0,fallbackAxisSideDirection:"start"}),pg({crossAxis:!0,padding:8}),kF({apply({availableHeight:se,availableWidth:Re,elements:Ye,rects:rt}){const It=Math.min(typeof Re=="number"?Re-64:R,R),to=rt.reference.width,no=Math.max(to,k);Object.assign(Ye.floating.style,{maxHeight:typeof se=="number"?`${se}px`:"auto",maxWidth:`${It}px`,minWidth:`${no}px`,width:"max-content"})}})],whileElementsMounted:hg}),me=S.useMemo(()=>n?re||[]:re!=null?[re]:[],[re,n]),ee=S.useCallback(se=>r?r(se):se,[r]),xe=S.useMemo(()=>{const se=new Map;return u.forEach(Re=>{se.set(ee(Re),Re)}),se},[u,ee]),Se=!u.length&&!_,Ee=S.useMemo(()=>me.map(se=>xe.get(se)).filter(se=>!!se),[xe,me]);S.useEffect(()=>{process.env.NODE_ENV!=="production"&&o&&!l&&console.warn("[Select] `renderItem` deprecated, use `renderDropdownItem` instead.")},[l,o]);const ze=S.useCallback((se,Re)=>l?l(se,Re):o?o(se):String(se),[l,o]),je=()=>{Q(!1),b?.()},Rt=se=>{const Re=ee(se);if(n){const Ye=me.includes(Re)?me.filter(rt=>rt!==Re):[...me,Re];U(Ye),t?.(Ye)}else U(Re),t?.(Re),je()},gn=se=>{if(!n)return;const Re=me.filter(Ye=>Ye!==se);U(Re),t?.(Re)},ot=()=>{const se=n?[]:null;U(se),t?.(se),n||je()},Gt=()=>typeof c=="string"?C.jsx(le,{variant:d==="xs"?"caption-1":"body-2",textOverflow:"ellipsis",overflow:"hidden",colorName:"tertiary",children:c??"Select..."}):c,Qt=()=>{if(!me.length)return Gt();if(n)return a?a(Ee):i?i({mode:"multiple",selectedItems:Ee}):C.jsx(q,{flexWrap:"wrap",row:!0,gap:10,children:me.map(Ye=>{const rt=xe.get(Ye);return rt?C.jsx(wg,{size:"sm",label:o?o(rt):String(Ye),onDelete:It=>{It.stopPropagation(),gn(Ye)}},Ye):null})});const se=xe.get(me[0])??null;if(!se)return Gt();if(s)return s(se);if(i)return i({mode:"single",selectedItem:se});const Re=o?o(se):String(me[0]);return typeof Re=="string"?C.jsx(le,{variant:d==="xs"?"caption-1":"body-2",tag:"p",textOverflow:"ellipsis",overflow:"hidden",children:Re}):C.jsx(C.Fragment,{children:Re})},pt=Z&&C.jsx(ts,{children:C.jsx(q,{row:!0,top:0,right:0,bottom:0,left:0,position:"fixed",center:!0,flex:1,onClick:je,display:"block",backgroundColor:"transparent",zIndex:1,children:C.jsx(ea.div,{ref:ne.setFloating,className:T.cx(dt["select-dropdown"],j),initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.25,ease:"easeInOut"},style:{...oe,zIndex:1},onMouseDown:se=>se.stopPropagation(),onClick:se=>se.stopPropagation(),children:C.jsxs("ul",{className:T.cx(dt["select-menu"],H),children:[h&&!n&&C.jsx(q,{className:T.cx(dt["select-menu-item"],O),role:"option",onClick:ot,children:C.jsx(le,{variant:"body-2",colorName:"tertiary",children:c})}),m&&C.jsx(q,{className:T.cx(dt["select-menu-item"],dt["select-menu-item-first"],O),children:m}),Se&&C.jsxs(q,{className:dt["empty-block"],children:[C.jsx(q,{w:20,h:20,children:C.jsx(GF,{})}),C.jsx(le,{variant:"body-2",children:x??"There is nothing yet"})]}),u.map((se,Re)=>{const Ye=ee(se),rt=me.includes(Ye),It=ze(se,{item:se,selected:rt,index:Re}),to=typeof It=="string";return C.jsxs(q,{row:!0,gap:10,alignItems:"center",className:T.cx(dt["select-menu-item"],{[dt.selected]:rt},O),role:"option",relative:!0,onClick:()=>Rt(se),children:[n&&C.jsx(hh,{size:"sm",checked:rt}),to?C.jsx(le,{variant:"body-2",tag:"p",wordBreak:"break-all",whiteSpace:"break-spaces",children:It}):It,C.jsx(zo,{})]},Ye)}),y,v&&C.jsx(q,{className:T.cx(dt["select-menu-item"],dt["select-menu-item-first"],O),children:v})]})},"dropdown")})});return C.jsxs(q,{relative:!0,display:"inline-block",minWidth:M,w:F||(f?"full":"auto"),onMouseDown:se=>se.stopPropagation(),onClick:se=>se.stopPropagation(),className:I,children:[typeof p=="string"?C.jsx(le,{variant:"body-2",colorName:"tertiary",fontWeight:"regular",mb:d==="sm"?4:8,className:P,children:p}):p,C.jsxs(q,{ref:ne.setReference,row:!0,gap:10,tabIndex:g?-1:0,role:"button",alignItems:"flex-start","aria-haspopup":"listbox",relative:!0,w:"100%",className:T.cx(dt["select-input"],dt[`size-${d}`],dt[`background-${D}`],{[dt.error]:_,[dt.disabled]:g,[dt.open]:Z},$),onClick:()=>!g&&Q(se=>!se),children:[C.jsx(q,{className:T.cx(dt["select-value"]),children:Qt()}),C.jsx(q,{className:T.cx(dt["select-arrow"],XF[d]),children:C.jsx(UF,{})})]}),typeof w=="string"?C.jsx(le,{variant:"caption-1",colorName:"tertiary",mt:4,className:K,children:w}):w,_&&E&&C.jsx(le,{tag:"p",colorName:"negative",variant:"body-2",mt:5,className:G,children:E}),C.jsx(Dx,{children:pt})]})}const ZF=e=>N.createElement("svg",{width:10,height:10,viewBox:"0 0 10 10",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M3.94629 0.220237C3.78013 0.264025 3.64089 0.377624 3.56348 0.53176C3.27371 1.11189 3.05664 1.46395 2.83887 1.74953C2.61807 2.03873 2.38547 2.27579 2.03027 2.63039C1.21079 3.45057 0.799805 4.52619 0.799805 5.60012C0.799838 6.67406 1.21073 7.74968 2.03027 8.56985C3.67062 10.2096 6.32931 10.2095 7.96973 8.56985C8.78929 7.74968 9.20016 6.67408 9.2002 5.60012C9.15131 4.32908 8.43217 3.48543 7.94727 3.05813C7.76902 2.90106 7.40643 3.02424 7.2627 3.2134C7.24031 3.24286 7.21612 3.2739 7.18945 3.30617C6.93211 3.61754 6.56236 3.80807 6.41504 3.83156C6.38264 3.83667 6.36979 3.76513 6.2959 3.58254C5.79455 2.34427 5.78927 2.49365 5.58887 2.01125C5.48847 1.7692 5.05517 1.02727 4.92676 0.828635C4.80206 0.635591 4.64095 0.439873 4.43359 0.301292C4.29028 0.205951 4.1124 0.175957 3.94629 0.220237ZM4.75293 4.17824C5.2689 4.63997 5.60857 5.26651 5.71484 5.95071C6.10631 5.85571 6.46727 5.68318 6.78125 5.45071C6.86578 5.70826 6.89338 5.98123 6.8623 6.25051C6.83115 6.51993 6.74174 6.77966 6.60059 7.01125C6.45944 7.24281 6.27008 7.44117 6.04492 7.59231C5.81977 7.74344 5.56462 7.8443 5.29688 7.88723C5.0292 7.93013 4.75518 7.91446 4.49414 7.84133C4.23299 7.76812 3.99064 7.6383 3.78418 7.46242C3.5778 7.28657 3.41161 7.06792 3.29785 6.8218C3.18419 6.57572 3.12519 6.30771 3.125 6.03664C3.12508 5.58233 3.29054 5.14308 3.58984 4.80129C3.88917 4.4597 4.30271 4.2382 4.75293 4.17824Z",fill:"#FEAD34"})),JF=e=>N.createElement("svg",{width:12,height:12,viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M10.1483 8.61509C10.3344 8.26159 9.98299 7.89856 9.58534 7.93723C9.42671 7.95265 9.25857 7.9605 9.07422 7.96035C6.36522 7.9582 4.17129 5.76427 4.16914 3.05527C4.169 2.87115 4.17682 2.70321 4.19221 2.54477C4.23082 2.14712 3.86769 1.79411 3.50976 1.97161C2.03398 2.70343 1.20002 4.02274 1.20002 5.89477C1.20002 8.60377 3.3961 10.7998 6.1051 10.7998C7.97571 10.7998 9.38737 10.06 10.1483 8.61509Z",fill:"white"})),{color:nn,cornerRadius:l0,height:Uu,spacing:QF,transition:c0}=V,$n={container:T.css({width:"100%",cursor:"pointer",outline:"none",userSelect:"none",display:"flex",justifyContent:"space-between",gap:QF.md,"&.disabled":{cursor:"not-allowed",opacity:.5},"&.reverse":{flexDirection:"row-reverse"}}),disabled:T.css({cursor:"not-allowed",opacity:.5}),reverse:T.css({flexDirection:"row-reverse"}),switchContainer:T.css({"--width-switch-sm":"34px","--width-switch-md":"40px","--width-switch-lg":"52px","--size-thumb-sm":"18px","--size-thumb-md":"20px","--size-thumb-lg":"28px","--thumb-translate":"0px","&:has(input:checked)":{"--thumb-translate":"calc(var(--switch-width) - var(--thumb-width) - 4px)"}}),variant_accent:T.css({"&:has(input:not(:checked))":{"--switch-bg-color":nn.fill.bgTertiary,"--thumb-bg-color":nn.fill.bgPrimary},"&:has(input:checked)":{"--switch-bg-color":nn.fill.accentPrimary,"--thumb-bg-color":nn.fill.bgPrimary}}),variant_secondary:T.css({"&:has(input:not(:checked))":{"--switch-bg-color":nn.fill.bgTertiary,"--thumb-bg-color":nn.fill.bgPrimary},"&:has(input:checked)":{"--switch-bg-color":nn.fill.accentSecondary,"--thumb-bg-color":nn.fill.accentPrimary}}),variant_theme:T.css({"&:has(input:not(:checked))":{"--switch-bg-color":nn.fill.bgTertiary,"--thumb-bg-color":nn.fill.bgPrimary},"&:has(input:checked)":{"--switch-bg-color":nn.fill.bgSecondary,"--thumb-bg-color":nn.fill.bgTertiary}}),size_sm:T.css({"--switch-width":"var(--width-switch-sm)","--switch-height":Uu.switch.sm,"--thumb-width":"var(--size-thumb-sm)","--thumb-height":"var(--size-thumb-sm)"}),size_md:T.css({"--switch-width":"var(--width-switch-md)","--switch-height":Uu.switch.md,"--thumb-width":"var(--size-thumb-md)","--thumb-height":"var(--size-thumb-md)"}),size_lg:T.css({"--switch-width":"var(--width-switch-lg)","--switch-height":Uu.switch.lg,"--thumb-width":"var(--size-thumb-lg)","--thumb-height":"var(--size-thumb-lg)"}),switch:T.css({width:"var(--switch-width)",height:"var(--switch-height)",transition:c0.general,display:"flex",alignItems:"center",padding:2,backgroundColor:"var(--switch-bg-color)",borderRadius:l0.xl}),thumb:T.css({display:"flex",alignItems:"center",justifyContent:"center",padding:4,transition:c0.general,transform:"translateX(var(--thumb-translate, 0))",width:"var(--thumb-width)",height:"var(--thumb-height)",backgroundColor:"var(--thumb-bg-color)",borderRadius:l0.fullRound}),moon:T.css({width:"100%",height:"100%"}),fire:T.css({width:"100%",height:"100%"})},{spacing:u0}=V,UC=S.forwardRef(({title:e,text:t,icon:n,disabled:r,onChange:o,checked:i,defaultValue:s,className:a,wrapperClassName:l,switchContainerClassName:c,trackClassName:u,thumbClassName:f,inputClassName:d,labelsContainerClassName:h,titleClassName:g,textClassName:p,size:m="md",variant:v="accent",reverse:y=!1,w:x="auto",...b},w)=>{const[_,E]=Bo(i,s),R=S.useRef(null);S.useImperativeHandle(w,()=>({focus:()=>{R.current?.focus()},blur:()=>{R.current?.blur()},get checked(){return _??!1},setChecked:D=>{E(D),o?.(D)},toggle:()=>{const D=!_;E(D),o?.(D)},isFocused:()=>document.activeElement===R.current,isDisabled:()=>r??!1,getInputElement:()=>R.current,checkValidity:()=>R.current?.checkValidity()??!0,reset:()=>{const D=s??!1;E(D),o?.(D)}}),[_,E,o,r,s]);const k=S.useCallback(D=>{E(D.target.checked),o?.(D.target.checked)},[o]),M=S.useMemo(()=>typeof e=="string"?C.jsx(le,{variant:"body-1",colorName:"primary",fontWeight:"medium",className:g,children:e}):e,[e,g]),F=S.useMemo(()=>typeof t=="string"?C.jsx(le,{variant:"body-2",colorName:"secondary",fontWeight:"regular",className:p,children:t}):t,[t,p]);return C.jsxs(q,{row:!0,w:x,gap:u0.sm,className:l,children:[C.jsxs("label",{className:T.cx($n.container,a,{[$n.disabled]:r,[$n.reverse]:y}),children:[C.jsxs(q,{className:T.cx($n.switchContainer,$n[`size_${m}`],$n[`variant_${v}`],c),children:[C.jsx("input",{ref:R,type:"checkbox",checked:_,hidden:!0,onChange:k,disabled:r,className:d,...b}),C.jsx("div",{className:T.cx($n.switch,u),children:C.jsx("div",{className:T.cx($n.thumb,f),children:v==="theme"&&(_?C.jsx(JF,{className:$n.moon}):C.jsx(ZF,{className:$n.fire}))})})]}),(M||F)&&C.jsxs(q,{gap:u0.xs,className:h,children:[M,F]})]}),n]})});UC.displayName="Switch";const{spacing:d0}=V,e$=T.css({cursor:"pointer",userSelect:"none"}),t$=T.css({cursor:"not-allowed",opacity:.5}),n$=T.css({transition:"color 0.2s ease"}),r$=S.forwardRef(({label:e,selected:t,disabled:n,fullWidth:r,onClick:o,className:i,activeClassName:s,textClassName:a},l)=>C.jsx(q,{w:r?"full":void 0,justifyContent:"center",alignItems:"center",ref:l,py:d0.md,px:d0.xl,onClick:o,className:T.cx(e$,{[t$]:n},i,t&&s),children:C.jsx(le,{className:T.cx(n$,a),colorName:t?"primary":"tertiary",fontWeight:"medium",variant:"body-2",children:e})})),{color:GC}=V,o$=T.css({borderBottom:`1px solid ${GC.border.neutralAlphaBasic}`}),qC=({value:e,onChange:t,options:n,fullWidth:r=!1,className:o,tabClassName:i,activeTabClassName:s,tabTextClassName:a,indicatorClassName:l})=>{const[c,u]=S.useState({left:0,width:0}),f=S.useRef([]),d=g=>p=>{f.current[g]=p};S.useEffect(()=>{const g=n.findIndex(m=>m.value===e),p=f.current[g];p&&u({left:p.offsetLeft,width:p.offsetWidth})},[e,n]);const h=(g,p=!1)=>()=>!p&&t(g);return C.jsxs(q,{row:!0,w:r?"full":"auto",relative:!0,className:T.cx(o$,o),children:[n.map((g,p)=>C.jsx(r$,{selected:e===g.value,onClick:h(g.value,g.disabled),ref:d(p),label:g.label,disabled:g.disabled,fullWidth:r,className:i,activeClassName:s,textClassName:a},g.value)),C.jsx(q,{h:2,w:c.width,absolute:!0,bottom:-1,left:c.left,backgroundColor:GC.border.accentPrimary,className:T.cx(T.css({transition:"left 0.2s ease, width 0.2s ease"}),l)})]})};qC.displayName="Tabs";const YC=S.forwardRef(({title:e,subtitle:t,w:n="full",p:r,py:o,px:i=V.spacing["2xl"],pt:s=V.spacing["2xl"],pb:a=V.spacing.lg,row:l=!0,justifyContent:c="space-between",showCloseButton:u=!1,className:f,titleClassName:d,subtitleClassName:h,closeButtonClassName:g},p)=>{const{onClose:m}=Y_();return C.jsxs(q,{w:n,p:r,py:o,px:i,pt:s,pb:a,row:l,justifyContent:c,ref:p,borderColor:V.color.border.neutralAlphaBasic,borderWidth:0,borderBottomWidth:1,borderStyle:"solid",className:f,children:[C.jsxs(q,{gap:V.spacing.sm,children:[C.jsx(le,{variant:"title-3",colorName:"primary",fontWeight:"semibold",className:d,children:e}),C.jsx(le,{variant:"body-1",colorName:"tertiary",fontWeight:"medium",className:h,children:t})]}),u&&C.jsx(q,{children:C.jsx(pr,{onClick:m,color:"neutral",className:g,children:C.jsx(B0,{})})})]})});YC.displayName="ModalHeader";function ii(e,t,n){let r=n.initialDeps??[],o,i=!0;function s(){var a,l,c;let u;n.key&&((a=n.debug)!=null&&a.call(n))&&(u=Date.now());const f=e();if(!(f.length!==r.length||f.some((g,p)=>r[p]!==g)))return o;r=f;let h;if(n.key&&((l=n.debug)!=null&&l.call(n))&&(h=Date.now()),o=t(...f),n.key&&((c=n.debug)!=null&&c.call(n))){const g=Math.round((Date.now()-u)*100)/100,p=Math.round((Date.now()-h)*100)/100,m=p/16,v=(y,x)=>{for(y=String(y);y.length<x;)y=" "+y;return y};console.info(`%c⏱ ${v(p,5)} /${v(g,5)} ms`,`
67
67
  font-size: .6rem;
68
68
  font-weight: bold;
69
- color: hsl(${Math.max(0,Math.min(120-120*m,120))}deg 100% 31%);`,n?.key)}return n?.onChange&&!(i&&n.skipInitialOnChange)&&n.onChange(o),i=!1,o}return s.updateDeps=a=>{r=a},s}function c0(e,t){if(e===void 0)throw new Error("Unexpected undefined");return e}const n$=(e,t)=>Math.abs(e-t)<1.01,r$=(e,t,n)=>{let r;return function(...o){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,o),n)}},u0=e=>{const{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},o$=e=>e,i$=e=>{const t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1),r=[];for(let o=t;o<=n;o++)r.push(o);return r},s$=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;const o=s=>{const{width:a,height:l}=s;t({width:Math.round(a),height:Math.round(l)})};if(o(u0(n)),!r.ResizeObserver)return()=>{};const i=new r.ResizeObserver(s=>{const a=()=>{const l=s[0];if(l?.borderBoxSize){const c=l.borderBoxSize[0];if(c){o({width:c.inlineSize,height:c.blockSize});return}}o(u0(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()});return i.observe(n,{box:"border-box"}),()=>{i.unobserve(n)}},d0={passive:!0},f0=typeof window>"u"?!0:"onscrollend"in window,a$=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;let o=0;const i=e.options.useScrollendEvent&&f0?()=>{}:r$(r,()=>{t(o,!1)},e.options.isScrollingResetDelay),s=u=>()=>{const{horizontal:f,isRtl:d}=e.options;o=f?n.scrollLeft*(d&&-1||1):n.scrollTop,i(),t(o,u)},a=s(!0),l=s(!1);l(),n.addEventListener("scroll",a,d0);const c=e.options.useScrollendEvent&&f0;return c&&n.addEventListener("scrollend",l,d0),()=>{n.removeEventListener("scroll",a),c&&n.removeEventListener("scrollend",l)}},l$=(e,t,n)=>{if(t?.borderBoxSize){const r=t.borderBoxSize[0];if(r)return Math.round(r[n.options.horizontal?"inlineSize":"blockSize"])}return e[n.options.horizontal?"offsetWidth":"offsetHeight"]},c$=(e,{adjustments:t=0,behavior:n},r)=>{var o,i;const s=e+t;(i=(o=r.scrollElement)==null?void 0:o.scrollTo)==null||i.call(o,{[r.options.horizontal?"left":"top"]:s,behavior:n})};class u${constructor(t){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.measurementsCache=[],this.itemSizeCache=new Map,this.laneAssignments=new Map,this.pendingMeasuredCacheIndexes=[],this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let n=null;const r=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(o=>{o.forEach(i=>{const s=()=>{this._measureElement(i.target,i)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(s):s()})}));return{disconnect:()=>{var o;(o=r())==null||o.disconnect(),n=null},observe:o=>{var i;return(i=r())==null?void 0:i.observe(o,{box:"border-box"})},unobserve:o=>{var i;return(i=r())==null?void 0:i.unobserve(o)}}})(),this.range=null,this.setOptions=n=>{Object.entries(n).forEach(([r,o])=>{typeof o>"u"&&delete n[r]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:o$,rangeExtractor:i$,onChange:()=>{},measureElement:l$,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...n}},this.notify=n=>{var r,o;(o=(r=this.options).onChange)==null||o.call(r,this,n)},this.maybeNotify=Xo(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),n=>{this.notify(n)},{key:process.env.NODE_ENV!=="production"&&"maybeNotify",debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(n=>n()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var n;const r=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==r){if(this.cleanup(),!r){this.maybeNotify();return}this.scrollElement=r,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((n=this.scrollElement)==null?void 0:n.window)??null,this.elementsCache.forEach(o=>{this.observer.observe(o)}),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,o=>{this.scrollRect=o,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(o,i)=>{this.scrollAdjustments=0,this.scrollDirection=i?this.getScrollOffset()<o?"forward":"backward":null,this.scrollOffset=o,this.isScrolling=i,this.maybeNotify()}))}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(n,r)=>{const o=new Map,i=new Map;for(let s=r-1;s>=0;s--){const a=n[s];if(o.has(a.lane))continue;const l=i.get(a.lane);if(l==null||a.end>l.end?i.set(a.lane,a):a.end<l.end&&o.set(a.lane,!0),o.size===this.options.lanes)break}return i.size===this.options.lanes?Array.from(i.values()).sort((s,a)=>s.end===a.end?s.index-a.index:s.end-a.end)[0]:void 0},this.getMeasurementOptions=Xo(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes],(n,r,o,i,s,a)=>(this.prevLanes!==void 0&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMeasuredCacheIndexes=[],{count:n,paddingStart:r,scrollMargin:o,getItemKey:i,enabled:s,lanes:a}),{key:!1,skipInitialOnChange:!0,onChange:()=>{this.notify(this.isScrolling)}}),this.getMeasurements=Xo(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:n,paddingStart:r,scrollMargin:o,getItemKey:i,enabled:s,lanes:a},l)=>{if(!s)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>n)for(const d of this.laneAssignments.keys())d>=n&&this.laneAssignments.delete(d);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMeasuredCacheIndexes=[]),this.measurementsCache.length===0&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(d=>{this.itemSizeCache.set(d.key,d.size)}));const c=this.lanesSettling?0:this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[],this.lanesSettling&&this.measurementsCache.length===n&&(this.lanesSettling=!1);const u=this.measurementsCache.slice(0,c),f=new Array(a).fill(void 0);for(let d=0;d<c;d++){const h=u[d];h&&(f[h.lane]=d)}for(let d=c;d<n;d++){const h=i(d),g=this.laneAssignments.get(d);let p,m;if(g!==void 0&&this.options.lanes>1){p=g;const b=f[p],w=b!==void 0?u[b]:void 0;m=w?w.end+this.options.gap:r+o}else{const b=this.options.lanes===1?u[d-1]:this.getFurthestMeasurement(u,d);m=b?b.end+this.options.gap:r+o,p=b?b.lane:d%this.options.lanes,this.options.lanes>1&&this.laneAssignments.set(d,p)}const x=l.get(h),y=typeof x=="number"?x:this.options.estimateSize(d),v=m+y;u[d]={index:d,start:m,size:y,end:v,key:h,lane:p},f[p]=d}return this.measurementsCache=u,u},{key:process.env.NODE_ENV!=="production"&&"getMeasurements",debug:()=>this.options.debug}),this.calculateRange=Xo(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,r,o,i)=>this.range=n.length>0&&r>0?d$({measurements:n,outerSize:r,scrollOffset:o,lanes:i}):null,{key:process.env.NODE_ENV!=="production"&&"calculateRange",debug:()=>this.options.debug}),this.getVirtualIndexes=Xo(()=>{let n=null,r=null;const o=this.calculateRange();return o&&(n=o.startIndex,r=o.endIndex),this.maybeNotify.updateDeps([this.isScrolling,n,r]),[this.options.rangeExtractor,this.options.overscan,this.options.count,n,r]},(n,r,o,i,s)=>i===null||s===null?[]:n({startIndex:i,endIndex:s,overscan:r,count:o}),{key:process.env.NODE_ENV!=="production"&&"getVirtualIndexes",debug:()=>this.options.debug}),this.indexFromElement=n=>{const r=this.options.indexAttribute,o=n.getAttribute(r);return o?parseInt(o,10):(console.warn(`Missing attribute name '${r}={index}' on measured element.`),-1)},this._measureElement=(n,r)=>{const o=this.indexFromElement(n),i=this.measurementsCache[o];if(!i)return;const s=i.key,a=this.elementsCache.get(s);a!==n&&(a&&this.observer.unobserve(a),this.observer.observe(n),this.elementsCache.set(s,n)),n.isConnected&&this.resizeItem(o,this.options.measureElement(n,r,this))},this.resizeItem=(n,r)=>{const o=this.measurementsCache[n];if(!o)return;const i=this.itemSizeCache.get(o.key)??o.size,s=r-i;s!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(o,s,this):o.start<this.getScrollOffset()+this.scrollAdjustments)&&(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("correction",s),this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=s,behavior:void 0})),this.pendingMeasuredCacheIndexes.push(o.index),this.itemSizeCache=new Map(this.itemSizeCache.set(o.key,r)),this.notify(!1))},this.measureElement=n=>{if(!n){this.elementsCache.forEach((r,o)=>{r.isConnected||(this.observer.unobserve(r),this.elementsCache.delete(o))});return}this._measureElement(n,void 0)},this.getVirtualItems=Xo(()=>[this.getVirtualIndexes(),this.getMeasurements()],(n,r)=>{const o=[];for(let i=0,s=n.length;i<s;i++){const a=n[i],l=r[a];o.push(l)}return o},{key:process.env.NODE_ENV!=="production"&&"getVirtualItems",debug:()=>this.options.debug}),this.getVirtualItemForOffset=n=>{const r=this.getMeasurements();if(r.length!==0)return c0(r[KC(0,r.length-1,o=>c0(r[o]).start,n)])},this.getOffsetForAlignment=(n,r,o=0)=>{const i=this.getSize(),s=this.getScrollOffset();r==="auto"&&(r=n>=s+i?"end":"start"),r==="center"?n+=(o-i)/2:r==="end"&&(n-=i);const a=this.getTotalSize()+this.options.scrollMargin-i;return Math.max(Math.min(a,n),0)},this.getOffsetForIndex=(n,r="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));const o=this.measurementsCache[n];if(!o)return;const i=this.getSize(),s=this.getScrollOffset();if(r==="auto")if(o.end>=s+i-this.options.scrollPaddingEnd)r="end";else if(o.start<=s+this.options.scrollPaddingStart)r="start";else return[s,r];const a=r==="end"?o.end+this.options.scrollPaddingEnd:o.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,r,o.size),r]},this.isDynamicMode=()=>this.elementsCache.size>0,this.scrollToOffset=(n,{align:r="start",behavior:o}={})=>{o==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(n,r),{adjustments:void 0,behavior:o})},this.scrollToIndex=(n,{align:r="auto",behavior:o}={})=>{o==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),n=Math.max(0,Math.min(n,this.options.count-1));let i=0;const s=10,a=c=>{if(!this.targetWindow)return;const u=this.getOffsetForIndex(n,c);if(!u){console.warn("Failed to get offset for index:",n);return}const[f,d]=u;this._scrollToOffset(f,{adjustments:void 0,behavior:o}),this.targetWindow.requestAnimationFrame(()=>{const h=this.getScrollOffset(),g=this.getOffsetForIndex(n,d);if(!g){console.warn("Failed to get offset for index:",n);return}n$(g[0],h)||l(d)})},l=c=>{this.targetWindow&&(i++,i<s?(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("Schedule retry",i,s),this.targetWindow.requestAnimationFrame(()=>a(c))):console.warn(`Failed to scroll to index ${n} after ${s} attempts.`))};a(r)},this.scrollBy=(n,{behavior:r}={})=>{r==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+n,{adjustments:void 0,behavior:r})},this.getTotalSize=()=>{var n;const r=this.getMeasurements();let o;if(r.length===0)o=this.options.paddingStart;else if(this.options.lanes===1)o=((n=r[r.length-1])==null?void 0:n.end)??0;else{const i=Array(this.options.lanes).fill(null);let s=r.length-1;for(;s>=0&&i.some(a=>a===null);){const a=r[s];i[a.lane]===null&&(i[a.lane]=a.end),s--}o=Math.max(...i.filter(a=>a!==null))}return Math.max(o-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(n,{adjustments:r,behavior:o})=>{this.options.scrollToFn(n,{behavior:o,adjustments:r},this)},this.measure=()=>{this.itemSizeCache=new Map,this.laneAssignments=new Map,this.notify(!1)},this.setOptions(t)}}const KC=(e,t,n,r)=>{for(;e<=t;){const o=(e+t)/2|0,i=n(o);if(i<r)e=o+1;else if(i>r)t=o-1;else return o}return e>0?e-1:0};function d$({measurements:e,outerSize:t,scrollOffset:n,lanes:r}){const o=e.length-1,i=l=>e[l].start;if(e.length<=r)return{startIndex:0,endIndex:o};let s=KC(0,o,i,n),a=s;if(r===1)for(;a<o&&e[a].end<n+t;)a++;else if(r>1){const l=Array(r).fill(0);for(;a<o&&l.some(u=>u<n+t);){const u=e[a];l[u.lane]=u.end,a++}const c=Array(r).fill(n+t);for(;s>=0&&c.some(u=>u>=n);){const u=e[s];c[u.lane]=u.start,s--}s=Math.max(0,s-s%r),a=Math.min(o,a+(r-1-a%r))}return{startIndex:s,endIndex:a}}const h0=typeof document<"u"?M.useLayoutEffect:M.useEffect;function f$(e){const t=M.useReducer(()=>({}),{})[1],n={...e,onChange:(o,i)=>{var s;i?Rs.flushSync(t):t(),(s=e.onChange)==null||s.call(e,o,i)}},[r]=M.useState(()=>new u$(n));return r.setOptions(n),h0(()=>r._didMount(),[]),h0(()=>r._willUpdate()),r}function h$(e){return f$({observeElementRect:s$,observeElementOffset:a$,scrollToFn:c$,...e})}const g0={main:R.css({flex:0,overflowY:"auto",scrollbarWidth:"thin",scrollbarColor:`${j.color.scrollbar.thumbPrimary} ${j.color.scrollbar.trackPrimary}`,"&::-webkit-scrollbar":{width:6},"&::-webkit-scrollbar-track":{background:j.color.scrollbar.trackPrimary,borderRadius:j.cornerRadius.fullRound},"&::-webkit-scrollbar-thumb":{borderRadius:j.cornerRadius.fullRound,backgroundColor:j.color.scrollbar.thumbPrimary}})},UC=S.forwardRef(({children:e,className:t,row:n=!1,estimatedItemHeight:r=100,virtualize:o=!1,maxHeight:i=448},s)=>{const a=S.useRef(null),l=S.useMemo(()=>S.Children.toArray(e),[e]),c=h$({count:l.length,getScrollElement:()=>a.current,estimateSize:()=>r,measureElement:f=>f.getBoundingClientRect().height});return S.useImperativeHandle(s,()=>({scrollToTop:()=>c.scrollToOffset(0,{behavior:"smooth"}),scrollToBottom:()=>c.scrollToOffset(c.getTotalSize(),{behavior:"smooth"}),scrollToIndex:(f,d={})=>c.scrollToIndex(f,{behavior:"smooth",...d}),scrollToOffset:(f,d={})=>c.scrollToOffset(f,{behavior:"smooth",...d}),scrollBy:f=>{const d=c.scrollOffset||0;c.scrollToOffset(d+f,{behavior:"smooth"})},getElement:()=>a.current,getScrollOffset:()=>c.scrollOffset||0,getTotalSize:()=>c.getTotalSize()}),[c]),S.useMemo(()=>o||l.length>50,[o,l])&&l.length>0?C.jsx(G,{ref:a,row:n,maxHeight:i,className:R.cx(g0.main,t),w:"full",p:j.spacing["2xl"],children:C.jsx(G,{relative:!0,h:c.getTotalSize(),children:c.getVirtualItems().map(f=>C.jsx(G,{"data-index":f.index,ref:c.measureElement,w:"full",absolute:!0,style:{top:0,left:0,transform:`translateY(${f.start}px)`},children:l[f.index]},f.key))})}):C.jsx(G,{ref:a,className:R.cx(g0.main,t),w:"full",row:n,pl:j.spacing["2xl"],pr:j.spacing.xs,children:C.jsx(G,{py:j.spacing["2xl"],pr:j.spacing.xl,children:e})})});UC.displayName="ModalMain";const pc=D0;pc.Header=WC;pc.Main=UC;pc.Footer=j0;const GC=S.createContext(null),g$=()=>S.useContext(GC),Gi=({children:e})=>{const[t,n]=S.useState(null),r=g$();return S.useEffect(()=>{if(typeof document>"u")return;const o=r?.current??document.body;if(!o)return;let i=o.querySelector("[data-portal-root]")??void 0;i||(i=document.createElement("div"),i.setAttribute("data-portal-root","true"),o.appendChild(i)),n(i)},[r]),t?Rs.createPortal(e,t):null};function qC(){return{accessor:(e,t)=>typeof e=="function"?{...t,accessorFn:e}:{...t,accessorKey:e},display:e=>e,group:e=>e}}function Pr(e,t){return typeof e=="function"?e(t):e}function qt(e,t){return n=>{t.setState(r=>({...r,[e]:Pr(n,r[e])}))}}function mc(e){return e instanceof Function}function p$(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function m$(e,t){const n=[],r=o=>{o.forEach(i=>{n.push(i);const s=t(i);s!=null&&s.length&&r(s)})};return r(e),n}function ce(e,t,n){let r=[],o;return i=>{let s;n.key&&n.debug&&(s=Date.now());const a=e(i);if(!(a.length!==r.length||a.some((u,f)=>r[f]!==u)))return o;r=a;let c;if(n.key&&n.debug&&(c=Date.now()),o=t(...a),n==null||n.onChange==null||n.onChange(o),n.key&&n.debug&&n!=null&&n.debug()){const u=Math.round((Date.now()-s)*100)/100,f=Math.round((Date.now()-c)*100)/100,d=f/16,h=(g,p)=>{for(g=String(g);g.length<p;)g=" "+g;return g};console.info(`%c⏱ ${h(f,5)} /${h(u,5)} ms`,`
69
+ color: hsl(${Math.max(0,Math.min(120-120*m,120))}deg 100% 31%);`,n?.key)}return n?.onChange&&!(i&&n.skipInitialOnChange)&&n.onChange(o),i=!1,o}return s.updateDeps=a=>{r=a},s}function f0(e,t){if(e===void 0)throw new Error("Unexpected undefined");return e}const i$=(e,t)=>Math.abs(e-t)<1.01,s$=(e,t,n)=>{let r;return function(...o){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,o),n)}},h0=e=>{const{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},a$=e=>e,l$=e=>{const t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1),r=[];for(let o=t;o<=n;o++)r.push(o);return r},c$=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;const o=s=>{const{width:a,height:l}=s;t({width:Math.round(a),height:Math.round(l)})};if(o(h0(n)),!r.ResizeObserver)return()=>{};const i=new r.ResizeObserver(s=>{const a=()=>{const l=s[0];if(l?.borderBoxSize){const c=l.borderBoxSize[0];if(c){o({width:c.inlineSize,height:c.blockSize});return}}o(h0(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()});return i.observe(n,{box:"border-box"}),()=>{i.unobserve(n)}},g0={passive:!0},p0=typeof window>"u"?!0:"onscrollend"in window,u$=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;let o=0;const i=e.options.useScrollendEvent&&p0?()=>{}:s$(r,()=>{t(o,!1)},e.options.isScrollingResetDelay),s=u=>()=>{const{horizontal:f,isRtl:d}=e.options;o=f?n.scrollLeft*(d&&-1||1):n.scrollTop,i(),t(o,u)},a=s(!0),l=s(!1);l(),n.addEventListener("scroll",a,g0);const c=e.options.useScrollendEvent&&p0;return c&&n.addEventListener("scrollend",l,g0),()=>{n.removeEventListener("scroll",a),c&&n.removeEventListener("scrollend",l)}},d$=(e,t,n)=>{if(t?.borderBoxSize){const r=t.borderBoxSize[0];if(r)return Math.round(r[n.options.horizontal?"inlineSize":"blockSize"])}return e[n.options.horizontal?"offsetWidth":"offsetHeight"]},f$=(e,{adjustments:t=0,behavior:n},r)=>{var o,i;const s=e+t;(i=(o=r.scrollElement)==null?void 0:o.scrollTo)==null||i.call(o,{[r.options.horizontal?"left":"top"]:s,behavior:n})};class h${constructor(t){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.measurementsCache=[],this.itemSizeCache=new Map,this.laneAssignments=new Map,this.pendingMeasuredCacheIndexes=[],this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let n=null;const r=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(o=>{o.forEach(i=>{const s=()=>{this._measureElement(i.target,i)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(s):s()})}));return{disconnect:()=>{var o;(o=r())==null||o.disconnect(),n=null},observe:o=>{var i;return(i=r())==null?void 0:i.observe(o,{box:"border-box"})},unobserve:o=>{var i;return(i=r())==null?void 0:i.unobserve(o)}}})(),this.range=null,this.setOptions=n=>{Object.entries(n).forEach(([r,o])=>{typeof o>"u"&&delete n[r]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:a$,rangeExtractor:l$,onChange:()=>{},measureElement:d$,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...n}},this.notify=n=>{var r,o;(o=(r=this.options).onChange)==null||o.call(r,this,n)},this.maybeNotify=ii(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),n=>{this.notify(n)},{key:process.env.NODE_ENV!=="production"&&"maybeNotify",debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(n=>n()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var n;const r=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==r){if(this.cleanup(),!r){this.maybeNotify();return}this.scrollElement=r,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((n=this.scrollElement)==null?void 0:n.window)??null,this.elementsCache.forEach(o=>{this.observer.observe(o)}),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,o=>{this.scrollRect=o,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(o,i)=>{this.scrollAdjustments=0,this.scrollDirection=i?this.getScrollOffset()<o?"forward":"backward":null,this.scrollOffset=o,this.isScrolling=i,this.maybeNotify()}))}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(n,r)=>{const o=new Map,i=new Map;for(let s=r-1;s>=0;s--){const a=n[s];if(o.has(a.lane))continue;const l=i.get(a.lane);if(l==null||a.end>l.end?i.set(a.lane,a):a.end<l.end&&o.set(a.lane,!0),o.size===this.options.lanes)break}return i.size===this.options.lanes?Array.from(i.values()).sort((s,a)=>s.end===a.end?s.index-a.index:s.end-a.end)[0]:void 0},this.getMeasurementOptions=ii(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes],(n,r,o,i,s,a)=>(this.prevLanes!==void 0&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMeasuredCacheIndexes=[],{count:n,paddingStart:r,scrollMargin:o,getItemKey:i,enabled:s,lanes:a}),{key:!1,skipInitialOnChange:!0,onChange:()=>{this.notify(this.isScrolling)}}),this.getMeasurements=ii(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:n,paddingStart:r,scrollMargin:o,getItemKey:i,enabled:s,lanes:a},l)=>{if(!s)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>n)for(const d of this.laneAssignments.keys())d>=n&&this.laneAssignments.delete(d);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMeasuredCacheIndexes=[]),this.measurementsCache.length===0&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(d=>{this.itemSizeCache.set(d.key,d.size)}));const c=this.lanesSettling?0:this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[],this.lanesSettling&&this.measurementsCache.length===n&&(this.lanesSettling=!1);const u=this.measurementsCache.slice(0,c),f=new Array(a).fill(void 0);for(let d=0;d<c;d++){const h=u[d];h&&(f[h.lane]=d)}for(let d=c;d<n;d++){const h=i(d),g=this.laneAssignments.get(d);let p,m;if(g!==void 0&&this.options.lanes>1){p=g;const b=f[p],w=b!==void 0?u[b]:void 0;m=w?w.end+this.options.gap:r+o}else{const b=this.options.lanes===1?u[d-1]:this.getFurthestMeasurement(u,d);m=b?b.end+this.options.gap:r+o,p=b?b.lane:d%this.options.lanes,this.options.lanes>1&&this.laneAssignments.set(d,p)}const v=l.get(h),y=typeof v=="number"?v:this.options.estimateSize(d),x=m+y;u[d]={index:d,start:m,size:y,end:x,key:h,lane:p},f[p]=d}return this.measurementsCache=u,u},{key:process.env.NODE_ENV!=="production"&&"getMeasurements",debug:()=>this.options.debug}),this.calculateRange=ii(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,r,o,i)=>this.range=n.length>0&&r>0?g$({measurements:n,outerSize:r,scrollOffset:o,lanes:i}):null,{key:process.env.NODE_ENV!=="production"&&"calculateRange",debug:()=>this.options.debug}),this.getVirtualIndexes=ii(()=>{let n=null,r=null;const o=this.calculateRange();return o&&(n=o.startIndex,r=o.endIndex),this.maybeNotify.updateDeps([this.isScrolling,n,r]),[this.options.rangeExtractor,this.options.overscan,this.options.count,n,r]},(n,r,o,i,s)=>i===null||s===null?[]:n({startIndex:i,endIndex:s,overscan:r,count:o}),{key:process.env.NODE_ENV!=="production"&&"getVirtualIndexes",debug:()=>this.options.debug}),this.indexFromElement=n=>{const r=this.options.indexAttribute,o=n.getAttribute(r);return o?parseInt(o,10):(console.warn(`Missing attribute name '${r}={index}' on measured element.`),-1)},this._measureElement=(n,r)=>{const o=this.indexFromElement(n),i=this.measurementsCache[o];if(!i)return;const s=i.key,a=this.elementsCache.get(s);a!==n&&(a&&this.observer.unobserve(a),this.observer.observe(n),this.elementsCache.set(s,n)),n.isConnected&&this.resizeItem(o,this.options.measureElement(n,r,this))},this.resizeItem=(n,r)=>{const o=this.measurementsCache[n];if(!o)return;const i=this.itemSizeCache.get(o.key)??o.size,s=r-i;s!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(o,s,this):o.start<this.getScrollOffset()+this.scrollAdjustments)&&(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("correction",s),this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=s,behavior:void 0})),this.pendingMeasuredCacheIndexes.push(o.index),this.itemSizeCache=new Map(this.itemSizeCache.set(o.key,r)),this.notify(!1))},this.measureElement=n=>{if(!n){this.elementsCache.forEach((r,o)=>{r.isConnected||(this.observer.unobserve(r),this.elementsCache.delete(o))});return}this._measureElement(n,void 0)},this.getVirtualItems=ii(()=>[this.getVirtualIndexes(),this.getMeasurements()],(n,r)=>{const o=[];for(let i=0,s=n.length;i<s;i++){const a=n[i],l=r[a];o.push(l)}return o},{key:process.env.NODE_ENV!=="production"&&"getVirtualItems",debug:()=>this.options.debug}),this.getVirtualItemForOffset=n=>{const r=this.getMeasurements();if(r.length!==0)return f0(r[XC(0,r.length-1,o=>f0(r[o]).start,n)])},this.getOffsetForAlignment=(n,r,o=0)=>{const i=this.getSize(),s=this.getScrollOffset();r==="auto"&&(r=n>=s+i?"end":"start"),r==="center"?n+=(o-i)/2:r==="end"&&(n-=i);const a=this.getTotalSize()+this.options.scrollMargin-i;return Math.max(Math.min(a,n),0)},this.getOffsetForIndex=(n,r="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));const o=this.measurementsCache[n];if(!o)return;const i=this.getSize(),s=this.getScrollOffset();if(r==="auto")if(o.end>=s+i-this.options.scrollPaddingEnd)r="end";else if(o.start<=s+this.options.scrollPaddingStart)r="start";else return[s,r];const a=r==="end"?o.end+this.options.scrollPaddingEnd:o.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,r,o.size),r]},this.isDynamicMode=()=>this.elementsCache.size>0,this.scrollToOffset=(n,{align:r="start",behavior:o}={})=>{o==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(n,r),{adjustments:void 0,behavior:o})},this.scrollToIndex=(n,{align:r="auto",behavior:o}={})=>{o==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),n=Math.max(0,Math.min(n,this.options.count-1));let i=0;const s=10,a=c=>{if(!this.targetWindow)return;const u=this.getOffsetForIndex(n,c);if(!u){console.warn("Failed to get offset for index:",n);return}const[f,d]=u;this._scrollToOffset(f,{adjustments:void 0,behavior:o}),this.targetWindow.requestAnimationFrame(()=>{const h=this.getScrollOffset(),g=this.getOffsetForIndex(n,d);if(!g){console.warn("Failed to get offset for index:",n);return}i$(g[0],h)||l(d)})},l=c=>{this.targetWindow&&(i++,i<s?(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("Schedule retry",i,s),this.targetWindow.requestAnimationFrame(()=>a(c))):console.warn(`Failed to scroll to index ${n} after ${s} attempts.`))};a(r)},this.scrollBy=(n,{behavior:r}={})=>{r==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+n,{adjustments:void 0,behavior:r})},this.getTotalSize=()=>{var n;const r=this.getMeasurements();let o;if(r.length===0)o=this.options.paddingStart;else if(this.options.lanes===1)o=((n=r[r.length-1])==null?void 0:n.end)??0;else{const i=Array(this.options.lanes).fill(null);let s=r.length-1;for(;s>=0&&i.some(a=>a===null);){const a=r[s];i[a.lane]===null&&(i[a.lane]=a.end),s--}o=Math.max(...i.filter(a=>a!==null))}return Math.max(o-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(n,{adjustments:r,behavior:o})=>{this.options.scrollToFn(n,{behavior:o,adjustments:r},this)},this.measure=()=>{this.itemSizeCache=new Map,this.laneAssignments=new Map,this.notify(!1)},this.setOptions(t)}}const XC=(e,t,n,r)=>{for(;e<=t;){const o=(e+t)/2|0,i=n(o);if(i<r)e=o+1;else if(i>r)t=o-1;else return o}return e>0?e-1:0};function g$({measurements:e,outerSize:t,scrollOffset:n,lanes:r}){const o=e.length-1,i=l=>e[l].start;if(e.length<=r)return{startIndex:0,endIndex:o};let s=XC(0,o,i,n),a=s;if(r===1)for(;a<o&&e[a].end<n+t;)a++;else if(r>1){const l=Array(r).fill(0);for(;a<o&&l.some(u=>u<n+t);){const u=e[a];l[u.lane]=u.end,a++}const c=Array(r).fill(n+t);for(;s>=0&&c.some(u=>u>=n);){const u=e[s];c[u.lane]=u.start,s--}s=Math.max(0,s-s%r),a=Math.min(o,a+(r-1-a%r))}return{startIndex:s,endIndex:a}}const m0=typeof document<"u"?N.useLayoutEffect:N.useEffect;function p$(e){const t=N.useReducer(()=>({}),{})[1],n={...e,onChange:(o,i)=>{var s;i?$s.flushSync(t):t(),(s=e.onChange)==null||s.call(e,o,i)}},[r]=N.useState(()=>new h$(n));return r.setOptions(n),m0(()=>r._didMount(),[]),m0(()=>r._willUpdate()),r}function m$(e){return p$({observeElementRect:c$,observeElementOffset:u$,scrollToFn:f$,...e})}const y0={main:T.css({flex:0,overflowY:"auto",scrollbarWidth:"thin",scrollbarColor:`${V.color.scrollbar.thumbPrimary} ${V.color.scrollbar.trackPrimary}`,"&::-webkit-scrollbar":{width:6},"&::-webkit-scrollbar-track":{background:V.color.scrollbar.trackPrimary,borderRadius:V.cornerRadius.fullRound},"&::-webkit-scrollbar-thumb":{borderRadius:V.cornerRadius.fullRound,backgroundColor:V.color.scrollbar.thumbPrimary}})},ZC=S.forwardRef(({children:e,className:t,row:n=!1,estimatedItemHeight:r=100,virtualize:o=!1,maxHeight:i=448},s)=>{const a=S.useRef(null),l=S.useMemo(()=>S.Children.toArray(e),[e]),c=m$({count:l.length,getScrollElement:()=>a.current,estimateSize:()=>r,measureElement:f=>f.getBoundingClientRect().height});return S.useImperativeHandle(s,()=>({scrollToTop:()=>c.scrollToOffset(0,{behavior:"smooth"}),scrollToBottom:()=>c.scrollToOffset(c.getTotalSize(),{behavior:"smooth"}),scrollToIndex:(f,d={})=>c.scrollToIndex(f,{behavior:"smooth",...d}),scrollToOffset:(f,d={})=>c.scrollToOffset(f,{behavior:"smooth",...d}),scrollBy:f=>{const d=c.scrollOffset||0;c.scrollToOffset(d+f,{behavior:"smooth"})},getElement:()=>a.current,getScrollOffset:()=>c.scrollOffset||0,getTotalSize:()=>c.getTotalSize()}),[c]),S.useMemo(()=>o||l.length>50,[o,l])&&l.length>0?C.jsx(q,{ref:a,row:n,maxHeight:i,className:T.cx(y0.main,t),w:"full",p:V.spacing["2xl"],children:C.jsx(q,{relative:!0,h:c.getTotalSize(),children:c.getVirtualItems().map(f=>C.jsx(q,{"data-index":f.index,ref:c.measureElement,w:"full",absolute:!0,style:{top:0,left:0,transform:`translateY(${f.start}px)`},children:l[f.index]},f.key))})}):C.jsx(q,{ref:a,className:T.cx(y0.main,t),w:"full",row:n,pl:V.spacing["2xl"],pr:V.spacing.xs,children:C.jsx(q,{py:V.spacing["2xl"],pr:V.spacing.xl,children:e})})});ZC.displayName="ModalMain";const Sc=H0;Sc.Header=YC;Sc.Main=ZC;Sc.Footer=W0;const JC=S.createContext(null),y$=()=>S.useContext(JC),ts=({children:e})=>{const[t,n]=S.useState(null),r=y$();return S.useEffect(()=>{if(typeof document>"u")return;const o=r?.current??document.body;if(!o)return;let i=o.querySelector("[data-portal-root]")??void 0;i||(i=document.createElement("div"),i.setAttribute("data-portal-root","true"),o.appendChild(i)),n(i)},[r]),t?$s.createPortal(e,t):null};function QC(){return{accessor:(e,t)=>typeof e=="function"?{...t,accessorFn:e}:{...t,accessorKey:e},display:e=>e,group:e=>e}}function $r(e,t){return typeof e=="function"?e(t):e}function Jt(e,t){return n=>{t.setState(r=>({...r,[e]:$r(n,r[e])}))}}function _c(e){return e instanceof Function}function v$(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function x$(e,t){const n=[],r=o=>{o.forEach(i=>{n.push(i);const s=t(i);s!=null&&s.length&&r(s)})};return r(e),n}function ue(e,t,n){let r=[],o;return i=>{let s;n.key&&n.debug&&(s=Date.now());const a=e(i);if(!(a.length!==r.length||a.some((u,f)=>r[f]!==u)))return o;r=a;let c;if(n.key&&n.debug&&(c=Date.now()),o=t(...a),n==null||n.onChange==null||n.onChange(o),n.key&&n.debug&&n!=null&&n.debug()){const u=Math.round((Date.now()-s)*100)/100,f=Math.round((Date.now()-c)*100)/100,d=f/16,h=(g,p)=>{for(g=String(g);g.length<p;)g=" "+g;return g};console.info(`%c⏱ ${h(f,5)} /${h(u,5)} ms`,`
70
70
  font-size: .6rem;
71
71
  font-weight: bold;
72
- color: hsl(${Math.max(0,Math.min(120-120*d,120))}deg 100% 31%);`,n?.key)}return o}}function ue(e,t,n,r){return{debug:()=>{var o;return(o=e?.debugAll)!=null?o:e[t]},key:process.env.NODE_ENV==="development"&&n,onChange:r}}function y$(e,t,n,r){const o=()=>{var s;return(s=i.getValue())!=null?s:e.options.renderFallbackValue},i={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(r),renderValue:o,getContext:ce(()=>[e,n,t,i],(s,a,l,c)=>({table:s,column:a,row:l,cell:c,getValue:c.getValue,renderValue:c.renderValue}),ue(e.options,"debugCells","cell.getContext"))};return e._features.forEach(s=>{s.createCell==null||s.createCell(i,n,t,e)},{}),i}function v$(e,t,n,r){var o,i;const a={...e._getDefaultColumnDef(),...t},l=a.accessorKey;let c=(o=(i=a.id)!=null?i:l?typeof String.prototype.replaceAll=="function"?l.replaceAll(".","_"):l.replace(/\./g,"_"):void 0)!=null?o:typeof a.header=="string"?a.header:void 0,u;if(a.accessorFn?u=a.accessorFn:l&&(l.includes(".")?u=d=>{let h=d;for(const p of l.split(".")){var g;h=(g=h)==null?void 0:g[p],process.env.NODE_ENV!=="production"&&h===void 0&&console.warn(`"${p}" in deeply nested key "${l}" returned undefined.`)}return h}:u=d=>d[a.accessorKey]),!c)throw process.env.NODE_ENV!=="production"?new Error(a.accessorFn?"Columns require an id when using an accessorFn":"Columns require an id when using a non-string header"):new Error;let f={id:`${String(c)}`,accessorFn:u,parent:r,depth:n,columnDef:a,columns:[],getFlatColumns:ce(()=>[!0],()=>{var d;return[f,...(d=f.columns)==null?void 0:d.flatMap(h=>h.getFlatColumns())]},ue(e.options,"debugColumns","column.getFlatColumns")),getLeafColumns:ce(()=>[e._getOrderColumnsFn()],d=>{var h;if((h=f.columns)!=null&&h.length){let g=f.columns.flatMap(p=>p.getLeafColumns());return d(g)}return[f]},ue(e.options,"debugColumns","column.getLeafColumns"))};for(const d of e._features)d.createColumn==null||d.createColumn(f,e);return f}const vt="debugHeaders";function p0(e,t,n){var r;let i={id:(r=n.id)!=null?r:t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const s=[],a=l=>{l.subHeaders&&l.subHeaders.length&&l.subHeaders.map(a),s.push(l)};return a(i),s},getContext:()=>({table:e,header:i,column:t})};return e._features.forEach(s=>{s.createHeader==null||s.createHeader(i,e)}),i}const x$={createTable:e=>{e.getHeaderGroups=ce(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,o)=>{var i,s;const a=(i=r?.map(f=>n.find(d=>d.id===f)).filter(Boolean))!=null?i:[],l=(s=o?.map(f=>n.find(d=>d.id===f)).filter(Boolean))!=null?s:[],c=n.filter(f=>!(r!=null&&r.includes(f.id))&&!(o!=null&&o.includes(f.id)));return Da(t,[...a,...c,...l],e)},ue(e.options,vt,"getHeaderGroups")),e.getCenterHeaderGroups=ce(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,o)=>(n=n.filter(i=>!(r!=null&&r.includes(i.id))&&!(o!=null&&o.includes(i.id))),Da(t,n,e,"center")),ue(e.options,vt,"getCenterHeaderGroups")),e.getLeftHeaderGroups=ce(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,r)=>{var o;const i=(o=r?.map(s=>n.find(a=>a.id===s)).filter(Boolean))!=null?o:[];return Da(t,i,e,"left")},ue(e.options,vt,"getLeftHeaderGroups")),e.getRightHeaderGroups=ce(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,r)=>{var o;const i=(o=r?.map(s=>n.find(a=>a.id===s)).filter(Boolean))!=null?o:[];return Da(t,i,e,"right")},ue(e.options,vt,"getRightHeaderGroups")),e.getFooterGroups=ce(()=>[e.getHeaderGroups()],t=>[...t].reverse(),ue(e.options,vt,"getFooterGroups")),e.getLeftFooterGroups=ce(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),ue(e.options,vt,"getLeftFooterGroups")),e.getCenterFooterGroups=ce(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),ue(e.options,vt,"getCenterFooterGroups")),e.getRightFooterGroups=ce(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),ue(e.options,vt,"getRightFooterGroups")),e.getFlatHeaders=ce(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),ue(e.options,vt,"getFlatHeaders")),e.getLeftFlatHeaders=ce(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),ue(e.options,vt,"getLeftFlatHeaders")),e.getCenterFlatHeaders=ce(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),ue(e.options,vt,"getCenterFlatHeaders")),e.getRightFlatHeaders=ce(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),ue(e.options,vt,"getRightFlatHeaders")),e.getCenterLeafHeaders=ce(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),ue(e.options,vt,"getCenterLeafHeaders")),e.getLeftLeafHeaders=ce(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),ue(e.options,vt,"getLeftLeafHeaders")),e.getRightLeafHeaders=ce(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),ue(e.options,vt,"getRightLeafHeaders")),e.getLeafHeaders=ce(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,r)=>{var o,i,s,a,l,c;return[...(o=(i=t[0])==null?void 0:i.headers)!=null?o:[],...(s=(a=n[0])==null?void 0:a.headers)!=null?s:[],...(l=(c=r[0])==null?void 0:c.headers)!=null?l:[]].map(u=>u.getLeafHeaders()).flat()},ue(e.options,vt,"getLeafHeaders"))}};function Da(e,t,n,r){var o,i;let s=0;const a=function(d,h){h===void 0&&(h=1),s=Math.max(s,h),d.filter(g=>g.getIsVisible()).forEach(g=>{var p;(p=g.columns)!=null&&p.length&&a(g.columns,h+1)},0)};a(e);let l=[];const c=(d,h)=>{const g={depth:h,id:[r,`${h}`].filter(Boolean).join("_"),headers:[]},p=[];d.forEach(m=>{const x=[...p].reverse()[0],y=m.column.depth===g.depth;let v,b=!1;if(y&&m.column.parent?v=m.column.parent:(v=m.column,b=!0),x&&x?.column===v)x.subHeaders.push(m);else{const w=p0(n,v,{id:[r,h,v.id,m?.id].filter(Boolean).join("_"),isPlaceholder:b,placeholderId:b?`${p.filter(_=>_.column===v).length}`:void 0,depth:h,index:p.length});w.subHeaders.push(m),p.push(w)}g.headers.push(m),m.headerGroup=g}),l.push(g),h>0&&c(p,h-1)},u=t.map((d,h)=>p0(n,d,{depth:s,index:h}));c(u,s-1),l.reverse();const f=d=>d.filter(g=>g.column.getIsVisible()).map(g=>{let p=0,m=0,x=[0];g.subHeaders&&g.subHeaders.length?(x=[],f(g.subHeaders).forEach(v=>{let{colSpan:b,rowSpan:w}=v;p+=b,x.push(w)})):p=1;const y=Math.min(...x);return m=m+y,g.colSpan=p,g.rowSpan=m,{colSpan:p,rowSpan:m}});return f((o=(i=l[0])==null?void 0:i.headers)!=null?o:[]),l}const b$=(e,t,n,r,o,i,s)=>{let a={id:t,index:r,original:n,depth:o,parentId:s,_valuesCache:{},_uniqueValuesCache:{},getValue:l=>{if(a._valuesCache.hasOwnProperty(l))return a._valuesCache[l];const c=e.getColumn(l);if(c!=null&&c.accessorFn)return a._valuesCache[l]=c.accessorFn(a.original,r),a._valuesCache[l]},getUniqueValues:l=>{if(a._uniqueValuesCache.hasOwnProperty(l))return a._uniqueValuesCache[l];const c=e.getColumn(l);if(c!=null&&c.accessorFn)return c.columnDef.getUniqueValues?(a._uniqueValuesCache[l]=c.columnDef.getUniqueValues(a.original,r),a._uniqueValuesCache[l]):(a._uniqueValuesCache[l]=[a.getValue(l)],a._uniqueValuesCache[l])},renderValue:l=>{var c;return(c=a.getValue(l))!=null?c:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>m$(a.subRows,l=>l.subRows),getParentRow:()=>a.parentId?e.getRow(a.parentId,!0):void 0,getParentRows:()=>{let l=[],c=a;for(;;){const u=c.getParentRow();if(!u)break;l.push(u),c=u}return l.reverse()},getAllCells:ce(()=>[e.getAllLeafColumns()],l=>l.map(c=>y$(e,a,c,c.id)),ue(e.options,"debugRows","getAllCells")),_getAllCellsByColumnId:ce(()=>[a.getAllCells()],l=>l.reduce((c,u)=>(c[u.column.id]=u,c),{}),ue(e.options,"debugRows","getAllCellsByColumnId"))};for(let l=0;l<e._features.length;l++){const c=e._features[l];c==null||c.createRow==null||c.createRow(a,e)}return a},w$={createColumn:(e,t)=>{e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},YC=(e,t,n)=>{var r,o;const i=n==null||(r=n.toString())==null?void 0:r.toLowerCase();return!!(!((o=e.getValue(t))==null||(o=o.toString())==null||(o=o.toLowerCase())==null)&&o.includes(i))};YC.autoRemove=e=>_n(e);const XC=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};XC.autoRemove=e=>_n(e);const ZC=(e,t,n)=>{var r;return((r=e.getValue(t))==null||(r=r.toString())==null?void 0:r.toLowerCase())===n?.toLowerCase()};ZC.autoRemove=e=>_n(e);const JC=(e,t,n)=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(n)};JC.autoRemove=e=>_n(e);const QC=(e,t,n)=>!n.some(r=>{var o;return!((o=e.getValue(t))!=null&&o.includes(r))});QC.autoRemove=e=>_n(e)||!(e!=null&&e.length);const eS=(e,t,n)=>n.some(r=>{var o;return(o=e.getValue(t))==null?void 0:o.includes(r)});eS.autoRemove=e=>_n(e)||!(e!=null&&e.length);const tS=(e,t,n)=>e.getValue(t)===n;tS.autoRemove=e=>_n(e);const nS=(e,t,n)=>e.getValue(t)==n;nS.autoRemove=e=>_n(e);const pg=(e,t,n)=>{let[r,o]=n;const i=e.getValue(t);return i>=r&&i<=o};pg.resolveFilterValue=e=>{let[t,n]=e,r=typeof t!="number"?parseFloat(t):t,o=typeof n!="number"?parseFloat(n):n,i=t===null||Number.isNaN(r)?-1/0:r,s=n===null||Number.isNaN(o)?1/0:o;if(i>s){const a=i;i=s,s=a}return[i,s]};pg.autoRemove=e=>_n(e)||_n(e[0])&&_n(e[1]);const or={includesString:YC,includesStringSensitive:XC,equalsString:ZC,arrIncludes:JC,arrIncludesAll:QC,arrIncludesSome:eS,equals:tS,weakEquals:nS,inNumberRange:pg};function _n(e){return e==null||e===""}const C$={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:qt("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n?.getValue(e.id);return typeof r=="string"?or.includesString:typeof r=="number"?or.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?or.equals:Array.isArray(r)?or.arrIncludes:or.weakEquals},e.getFilterFn=()=>{var n,r;return mc(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(n=(r=t.options.filterFns)==null?void 0:r[e.columnDef.filterFn])!=null?n:or[e.columnDef.filterFn]},e.getCanFilter=()=>{var n,r,o;return((n=e.columnDef.enableColumnFilter)!=null?n:!0)&&((r=t.options.enableColumnFilters)!=null?r:!0)&&((o=t.options.enableFilters)!=null?o:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var n;return(n=t.getState().columnFilters)==null||(n=n.find(r=>r.id===e.id))==null?void 0:n.value},e.getFilterIndex=()=>{var n,r;return(n=(r=t.getState().columnFilters)==null?void 0:r.findIndex(o=>o.id===e.id))!=null?n:-1},e.setFilterValue=n=>{t.setColumnFilters(r=>{const o=e.getFilterFn(),i=r?.find(u=>u.id===e.id),s=Pr(n,i?i.value:void 0);if(m0(o,s,e)){var a;return(a=r?.filter(u=>u.id!==e.id))!=null?a:[]}const l={id:e.id,value:s};if(i){var c;return(c=r?.map(u=>u.id===e.id?l:u))!=null?c:[]}return r!=null&&r.length?[...r,l]:[l]})}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=t=>{const n=e.getAllLeafColumns(),r=o=>{var i;return(i=Pr(t,o))==null?void 0:i.filter(s=>{const a=n.find(l=>l.id===s.id);if(a){const l=a.getFilterFn();if(m0(l,s.value,a))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(r)},e.resetColumnFilters=t=>{var n,r;e.setColumnFilters(t?[]:(n=(r=e.initialState)==null?void 0:r.columnFilters)!=null?n:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel())}};function m0(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const S$=(e,t,n)=>n.reduce((r,o)=>{const i=o.getValue(e);return r+(typeof i=="number"?i:0)},0),_$=(e,t,n)=>{let r;return n.forEach(o=>{const i=o.getValue(e);i!=null&&(r>i||r===void 0&&i>=i)&&(r=i)}),r},T$=(e,t,n)=>{let r;return n.forEach(o=>{const i=o.getValue(e);i!=null&&(r<i||r===void 0&&i>=i)&&(r=i)}),r},E$=(e,t,n)=>{let r,o;return n.forEach(i=>{const s=i.getValue(e);s!=null&&(r===void 0?s>=s&&(r=o=s):(r>s&&(r=s),o<s&&(o=s)))}),[r,o]},R$=(e,t)=>{let n=0,r=0;if(t.forEach(o=>{let i=o.getValue(e);i!=null&&(i=+i)>=i&&(++n,r+=i)}),n)return r/n},k$=(e,t)=>{if(!t.length)return;const n=t.map(i=>i.getValue(e));if(!p$(n))return;if(n.length===1)return n[0];const r=Math.floor(n.length/2),o=n.sort((i,s)=>i-s);return n.length%2!==0?o[r]:(o[r-1]+o[r])/2},A$=(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),M$=(e,t)=>new Set(t.map(n=>n.getValue(e))).size,N$=(e,t)=>t.length,ju={sum:S$,min:_$,max:T$,extent:E$,mean:R$,median:k$,unique:A$,uniqueCount:M$,count:N$},P$={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,n;return(t=(n=e.getValue())==null||n.toString==null?void 0:n.toString())!=null?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:qt("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping(n=>n!=null&&n.includes(e.id)?n.filter(r=>r!==e.id):[...n??[],e.id])},e.getCanGroup=()=>{var n,r;return((n=e.columnDef.enableGrouping)!=null?n:!0)&&((r=t.options.enableGrouping)!=null?r:!0)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.includes(e.id)},e.getGroupedIndex=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const n=e.getCanGroup();return()=>{n&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n?.getValue(e.id);if(typeof r=="number")return ju.sum;if(Object.prototype.toString.call(r)==="[object Date]")return ju.extent},e.getAggregationFn=()=>{var n,r;if(!e)throw new Error;return mc(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(n=(r=t.options.aggregationFns)==null?void 0:r[e.columnDef.aggregationFn])!=null?n:ju[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var n,r;e.setGrouping(t?[]:(n=(r=e.initialState)==null?void 0:r.grouping)!=null?n:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=n=>{if(e._groupingValuesCache.hasOwnProperty(n))return e._groupingValuesCache[n];const r=t.getColumn(n);return r!=null&&r.columnDef.getGroupingValue?(e._groupingValuesCache[n]=r.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},e._groupingValuesCache={}},createCell:(e,t,n,r)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===n.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var o;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((o=n.subRows)!=null&&o.length)}}};function L$(e,t,n){if(!(t!=null&&t.length)||!n)return e;const r=e.filter(i=>!t.includes(i.id));return n==="remove"?r:[...t.map(i=>e.find(s=>s.id===i)).filter(Boolean),...r]}const F$={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:qt("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=ce(n=>[Ts(t,n)],n=>n.findIndex(r=>r.id===e.id),ue(t.options,"debugColumns","getIndex")),e.getIsFirstColumn=n=>{var r;return((r=Ts(t,n)[0])==null?void 0:r.id)===e.id},e.getIsLastColumn=n=>{var r;const o=Ts(t,n);return((r=o[o.length-1])==null?void 0:r.id)===e.id}},createTable:e=>{e.setColumnOrder=t=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{var n;e.setColumnOrder(t?[]:(n=e.initialState.columnOrder)!=null?n:[])},e._getOrderColumnsFn=ce(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(t,n,r)=>o=>{let i=[];if(!(t!=null&&t.length))i=o;else{const s=[...t],a=[...o];for(;a.length&&s.length;){const l=s.shift(),c=a.findIndex(u=>u.id===l);c>-1&&i.push(a.splice(c,1)[0])}i=[...i,...a]}return L$(i,n,r)},ue(e.options,"debugTable","_getOrderColumnsFn"))}},Vu=()=>({left:[],right:[]}),$$={getInitialState:e=>({columnPinning:Vu(),...e}),getDefaultOptions:e=>({onColumnPinningChange:qt("columnPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const r=e.getLeafColumns().map(o=>o.id).filter(Boolean);t.setColumnPinning(o=>{var i,s;if(n==="right"){var a,l;return{left:((a=o?.left)!=null?a:[]).filter(f=>!(r!=null&&r.includes(f))),right:[...((l=o?.right)!=null?l:[]).filter(f=>!(r!=null&&r.includes(f))),...r]}}if(n==="left"){var c,u;return{left:[...((c=o?.left)!=null?c:[]).filter(f=>!(r!=null&&r.includes(f))),...r],right:((u=o?.right)!=null?u:[]).filter(f=>!(r!=null&&r.includes(f)))}}return{left:((i=o?.left)!=null?i:[]).filter(f=>!(r!=null&&r.includes(f))),right:((s=o?.right)!=null?s:[]).filter(f=>!(r!=null&&r.includes(f)))}})},e.getCanPin=()=>e.getLeafColumns().some(r=>{var o,i,s;return((o=r.columnDef.enablePinning)!=null?o:!0)&&((i=(s=t.options.enableColumnPinning)!=null?s:t.options.enablePinning)!=null?i:!0)}),e.getIsPinned=()=>{const n=e.getLeafColumns().map(a=>a.id),{left:r,right:o}=t.getState().columnPinning,i=n.some(a=>r?.includes(a)),s=n.some(a=>o?.includes(a));return i?"left":s?"right":!1},e.getPinnedIndex=()=>{var n,r;const o=e.getIsPinned();return o?(n=(r=t.getState().columnPinning)==null||(r=r[o])==null?void 0:r.indexOf(e.id))!=null?n:-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=ce(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(n,r,o)=>{const i=[...r??[],...o??[]];return n.filter(s=>!i.includes(s.column.id))},ue(t.options,"debugRows","getCenterVisibleCells")),e.getLeftVisibleCells=ce(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(n,r)=>(r??[]).map(i=>n.find(s=>s.column.id===i)).filter(Boolean).map(i=>({...i,position:"left"})),ue(t.options,"debugRows","getLeftVisibleCells")),e.getRightVisibleCells=ce(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(n,r)=>(r??[]).map(i=>n.find(s=>s.column.id===i)).filter(Boolean).map(i=>({...i,position:"right"})),ue(t.options,"debugRows","getRightVisibleCells"))},createTable:e=>{e.setColumnPinning=t=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var n,r;return e.setColumnPinning(t?Vu():(n=(r=e.initialState)==null?void 0:r.columnPinning)!=null?n:Vu())},e.getIsSomeColumnsPinned=t=>{var n;const r=e.getState().columnPinning;if(!t){var o,i;return!!((o=r.left)!=null&&o.length||(i=r.right)!=null&&i.length)}return!!((n=r[t])!=null&&n.length)},e.getLeftLeafColumns=ce(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(r=>t.find(o=>o.id===r)).filter(Boolean),ue(e.options,"debugColumns","getLeftLeafColumns")),e.getRightLeafColumns=ce(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(r=>t.find(o=>o.id===r)).filter(Boolean),ue(e.options,"debugColumns","getRightLeafColumns")),e.getCenterLeafColumns=ce(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r)=>{const o=[...n??[],...r??[]];return t.filter(i=>!o.includes(i.id))},ue(e.options,"debugColumns","getCenterLeafColumns"))}};function O$(e){return e||(typeof document<"u"?document:null)}const ja={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},Bu=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),I$={getDefaultColumnDef:()=>ja,getInitialState:e=>({columnSizing:{},columnSizingInfo:Bu(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:qt("columnSizing",e),onColumnSizingInfoChange:qt("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,r,o;const i=t.getState().columnSizing[e.id];return Math.min(Math.max((n=e.columnDef.minSize)!=null?n:ja.minSize,(r=i??e.columnDef.size)!=null?r:ja.size),(o=e.columnDef.maxSize)!=null?o:ja.maxSize)},e.getStart=ce(n=>[n,Ts(t,n),t.getState().columnSizing],(n,r)=>r.slice(0,e.getIndex(n)).reduce((o,i)=>o+i.getSize(),0),ue(t.options,"debugColumns","getStart")),e.getAfter=ce(n=>[n,Ts(t,n),t.getState().columnSizing],(n,r)=>r.slice(e.getIndex(n)+1).reduce((o,i)=>o+i.getSize(),0),ue(t.options,"debugColumns","getAfter")),e.resetSize=()=>{t.setColumnSizing(n=>{let{[e.id]:r,...o}=n;return o})},e.getCanResize=()=>{var n,r;return((n=e.columnDef.enableResizing)!=null?n:!0)&&((r=t.options.enableColumnResizing)!=null?r:!0)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let n=0;const r=o=>{if(o.subHeaders.length)o.subHeaders.forEach(r);else{var i;n+=(i=o.column.getSize())!=null?i:0}};return r(e),n},e.getStart=()=>{if(e.index>0){const n=e.headerGroup.headers[e.index-1];return n.getStart()+n.getSize()}return 0},e.getResizeHandler=n=>{const r=t.getColumn(e.column.id),o=r?.getCanResize();return i=>{if(!r||!o||(i.persist==null||i.persist(),zu(i)&&i.touches&&i.touches.length>1))return;const s=e.getSize(),a=e?e.getLeafHeaders().map(x=>[x.column.id,x.column.getSize()]):[[r.id,r.getSize()]],l=zu(i)?Math.round(i.touches[0].clientX):i.clientX,c={},u=(x,y)=>{typeof y=="number"&&(t.setColumnSizingInfo(v=>{var b,w;const _=t.options.columnResizeDirection==="rtl"?-1:1,E=(y-((b=v?.startOffset)!=null?b:0))*_,T=Math.max(E/((w=v?.startSize)!=null?w:0),-.999999);return v.columnSizingStart.forEach(k=>{let[P,O]=k;c[P]=Math.round(Math.max(O+O*T,0)*100)/100}),{...v,deltaOffset:E,deltaPercentage:T}}),(t.options.columnResizeMode==="onChange"||x==="end")&&t.setColumnSizing(v=>({...v,...c})))},f=x=>u("move",x),d=x=>{u("end",x),t.setColumnSizingInfo(y=>({...y,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},h=O$(n),g={moveHandler:x=>f(x.clientX),upHandler:x=>{h?.removeEventListener("mousemove",g.moveHandler),h?.removeEventListener("mouseup",g.upHandler),d(x.clientX)}},p={moveHandler:x=>(x.cancelable&&(x.preventDefault(),x.stopPropagation()),f(x.touches[0].clientX),!1),upHandler:x=>{var y;h?.removeEventListener("touchmove",p.moveHandler),h?.removeEventListener("touchend",p.upHandler),x.cancelable&&(x.preventDefault(),x.stopPropagation()),d((y=x.touches[0])==null?void 0:y.clientX)}},m=D$()?{passive:!1}:!1;zu(i)?(h?.addEventListener("touchmove",p.moveHandler,m),h?.addEventListener("touchend",p.upHandler,m)):(h?.addEventListener("mousemove",g.moveHandler,m),h?.addEventListener("mouseup",g.upHandler,m)),t.setColumnSizingInfo(x=>({...x,startOffset:l,startSize:s,deltaOffset:0,deltaPercentage:0,columnSizingStart:a,isResizingColumn:r.id}))}}},createTable:e=>{e.setColumnSizing=t=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var n;e.setColumnSizing(t?{}:(n=e.initialState.columnSizing)!=null?n:{})},e.resetHeaderSizeInfo=t=>{var n;e.setColumnSizingInfo(t?Bu():(n=e.initialState.columnSizingInfo)!=null?n:Bu())},e.getTotalSize=()=>{var t,n;return(t=(n=e.getHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getLeftTotalSize=()=>{var t,n;return(t=(n=e.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getCenterTotalSize=()=>{var t,n;return(t=(n=e.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getRightTotalSize=()=>{var t,n;return(t=(n=e.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0}}};let Va=null;function D$(){if(typeof Va=="boolean")return Va;let e=!1;try{const t={get passive(){return e=!0,!1}},n=()=>{};window.addEventListener("test",n,t),window.removeEventListener("test",n)}catch{e=!1}return Va=e,Va}function zu(e){return e.type==="touchstart"}const j$={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:qt("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility(r=>({...r,[e.id]:n??!e.getIsVisible()}))},e.getIsVisible=()=>{var n,r;const o=e.columns;return(n=o.length?o.some(i=>i.getIsVisible()):(r=t.getState().columnVisibility)==null?void 0:r[e.id])!=null?n:!0},e.getCanHide=()=>{var n,r;return((n=e.columnDef.enableHiding)!=null?n:!0)&&((r=t.options.enableHiding)!=null?r:!0)},e.getToggleVisibilityHandler=()=>n=>{e.toggleVisibility==null||e.toggleVisibility(n.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=ce(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(r=>r.column.getIsVisible()),ue(t.options,"debugRows","_getAllVisibleCells")),e.getVisibleCells=ce(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,r,o)=>[...n,...r,...o],ue(t.options,"debugRows","getVisibleCells"))},createTable:e=>{const t=(n,r)=>ce(()=>[r(),r().filter(o=>o.getIsVisible()).map(o=>o.id).join("_")],o=>o.filter(i=>i.getIsVisible==null?void 0:i.getIsVisible()),ue(e.options,"debugColumns",n));e.getVisibleFlatColumns=t("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=t("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=t("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=t("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=t("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=n=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(n),e.resetColumnVisibility=n=>{var r;e.setColumnVisibility(n?{}:(r=e.initialState.columnVisibility)!=null?r:{})},e.toggleAllColumnsVisible=n=>{var r;n=(r=n)!=null?r:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((o,i)=>({...o,[i.id]:n||!(i.getCanHide!=null&&i.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(n=>!(n.getIsVisible!=null&&n.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(n=>n.getIsVisible==null?void 0:n.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>n=>{var r;e.toggleAllColumnsVisible((r=n.target)==null?void 0:r.checked)}}};function Ts(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const V$={createTable:e=>{e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}},B$={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:qt("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n;const r=(n=e.getCoreRowModel().flatRows[0])==null||(n=n._getAllCellsByColumnId()[t.id])==null?void 0:n.getValue();return typeof r=="string"||typeof r=="number"}}),createColumn:(e,t)=>{e.getCanGlobalFilter=()=>{var n,r,o,i;return((n=e.columnDef.enableGlobalFilter)!=null?n:!0)&&((r=t.options.enableGlobalFilter)!=null?r:!0)&&((o=t.options.enableFilters)!=null?o:!0)&&((i=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?i:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>or.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:r}=e.options;return mc(r)?r:r==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[r])!=null?t:or[r]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},z$={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:qt("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var r,o;if(!t){e._queue(()=>{t=!0});return}if((r=(o=e.options.autoResetAll)!=null?o:e.options.autoResetExpanded)!=null?r:!e.options.manualExpanding){if(n)return;n=!0,e._queue(()=>{e.resetExpanded(),n=!1})}},e.setExpanded=r=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(r),e.toggleAllRowsExpanded=r=>{r??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=r=>{var o,i;e.setExpanded(r?{}:(o=(i=e.initialState)==null?void 0:i.expanded)!=null?o:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(r=>r.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>r=>{r.persist==null||r.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const r=e.getState().expanded;return r===!0||Object.values(r).some(Boolean)},e.getIsAllRowsExpanded=()=>{const r=e.getState().expanded;return typeof r=="boolean"?r===!0:!(!Object.keys(r).length||e.getRowModel().flatRows.some(o=>!o.getIsExpanded()))},e.getExpandedDepth=()=>{let r=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(i=>{const s=i.split(".");r=Math.max(r,s.length)}),r},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,t)=>{e.toggleExpanded=n=>{t.setExpanded(r=>{var o;const i=r===!0?!0:!!(r!=null&&r[e.id]);let s={};if(r===!0?Object.keys(t.getRowModel().rowsById).forEach(a=>{s[a]=!0}):s=r,n=(o=n)!=null?o:!i,!i&&n)return{...s,[e.id]:!0};if(i&&!n){const{[e.id]:a,...l}=s;return l}return r})},e.getIsExpanded=()=>{var n;const r=t.getState().expanded;return!!((n=t.options.getIsRowExpanded==null?void 0:t.options.getIsRowExpanded(e))!=null?n:r===!0||r?.[e.id])},e.getCanExpand=()=>{var n,r,o;return(n=t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))!=null?n:((r=t.options.enableExpanding)!=null?r:!0)&&!!((o=e.subRows)!=null&&o.length)},e.getIsAllParentsExpanded=()=>{let n=!0,r=e;for(;n&&r.parentId;)r=t.getRow(r.parentId,!0),n=r.getIsExpanded();return n},e.getToggleExpandedHandler=()=>{const n=e.getCanExpand();return()=>{n&&e.toggleExpanded()}}}},pf=0,mf=10,Hu=()=>({pageIndex:pf,pageSize:mf}),H$={getInitialState:e=>({...e,pagination:{...Hu(),...e?.pagination}}),getDefaultOptions:e=>({onPaginationChange:qt("pagination",e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{var r,o;if(!t){e._queue(()=>{t=!0});return}if((r=(o=e.options.autoResetAll)!=null?o:e.options.autoResetPageIndex)!=null?r:!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},e.setPagination=r=>{const o=i=>Pr(r,i);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(o)},e.resetPagination=r=>{var o;e.setPagination(r?Hu():(o=e.initialState.pagination)!=null?o:Hu())},e.setPageIndex=r=>{e.setPagination(o=>{let i=Pr(r,o.pageIndex);const s=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return i=Math.max(0,Math.min(i,s)),{...o,pageIndex:i}})},e.resetPageIndex=r=>{var o,i;e.setPageIndex(r?pf:(o=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageIndex)!=null?o:pf)},e.resetPageSize=r=>{var o,i;e.setPageSize(r?mf:(o=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageSize)!=null?o:mf)},e.setPageSize=r=>{e.setPagination(o=>{const i=Math.max(1,Pr(r,o.pageSize)),s=o.pageSize*o.pageIndex,a=Math.floor(s/i);return{...o,pageIndex:a,pageSize:i}})},e.setPageCount=r=>e.setPagination(o=>{var i;let s=Pr(r,(i=e.options.pageCount)!=null?i:-1);return typeof s=="number"&&(s=Math.max(-1,s)),{...o,pageCount:s}}),e.getPageOptions=ce(()=>[e.getPageCount()],r=>{let o=[];return r&&r>0&&(o=[...new Array(r)].fill(null).map((i,s)=>s)),o},ue(e.options,"debugTable","getPageOptions")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:r}=e.getState().pagination,o=e.getPageCount();return o===-1?!0:o===0?!1:r<o-1},e.previousPage=()=>e.setPageIndex(r=>r-1),e.nextPage=()=>e.setPageIndex(r=>r+1),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var r;return(r=e.options.pageCount)!=null?r:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var r;return(r=e.options.rowCount)!=null?r:e.getPrePaginationRowModel().rows.length}}},Wu=()=>({top:[],bottom:[]}),W$={getInitialState:e=>({rowPinning:Wu(),...e}),getDefaultOptions:e=>({onRowPinningChange:qt("rowPinning",e)}),createRow:(e,t)=>{e.pin=(n,r,o)=>{const i=r?e.getLeafRows().map(l=>{let{id:c}=l;return c}):[],s=o?e.getParentRows().map(l=>{let{id:c}=l;return c}):[],a=new Set([...s,e.id,...i]);t.setRowPinning(l=>{var c,u;if(n==="bottom"){var f,d;return{top:((f=l?.top)!=null?f:[]).filter(p=>!(a!=null&&a.has(p))),bottom:[...((d=l?.bottom)!=null?d:[]).filter(p=>!(a!=null&&a.has(p))),...Array.from(a)]}}if(n==="top"){var h,g;return{top:[...((h=l?.top)!=null?h:[]).filter(p=>!(a!=null&&a.has(p))),...Array.from(a)],bottom:((g=l?.bottom)!=null?g:[]).filter(p=>!(a!=null&&a.has(p)))}}return{top:((c=l?.top)!=null?c:[]).filter(p=>!(a!=null&&a.has(p))),bottom:((u=l?.bottom)!=null?u:[]).filter(p=>!(a!=null&&a.has(p)))}})},e.getCanPin=()=>{var n;const{enableRowPinning:r,enablePinning:o}=t.options;return typeof r=="function"?r(e):(n=r??o)!=null?n:!0},e.getIsPinned=()=>{const n=[e.id],{top:r,bottom:o}=t.getState().rowPinning,i=n.some(a=>r?.includes(a)),s=n.some(a=>o?.includes(a));return i?"top":s?"bottom":!1},e.getPinnedIndex=()=>{var n,r;const o=e.getIsPinned();if(!o)return-1;const i=(n=o==="top"?t.getTopRows():t.getBottomRows())==null?void 0:n.map(s=>{let{id:a}=s;return a});return(r=i?.indexOf(e.id))!=null?r:-1}},createTable:e=>{e.setRowPinning=t=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var n,r;return e.setRowPinning(t?Wu():(n=(r=e.initialState)==null?void 0:r.rowPinning)!=null?n:Wu())},e.getIsSomeRowsPinned=t=>{var n;const r=e.getState().rowPinning;if(!t){var o,i;return!!((o=r.top)!=null&&o.length||(i=r.bottom)!=null&&i.length)}return!!((n=r[t])!=null&&n.length)},e._getPinnedRows=(t,n,r)=>{var o;return((o=e.options.keepPinnedRows)==null||o?(n??[]).map(s=>{const a=e.getRow(s,!0);return a.getIsAllParentsExpanded()?a:null}):(n??[]).map(s=>t.find(a=>a.id===s))).filter(Boolean).map(s=>({...s,position:r}))},e.getTopRows=ce(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,"top"),ue(e.options,"debugRows","getTopRows")),e.getBottomRows=ce(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,"bottom"),ue(e.options,"debugRows","getBottomRows")),e.getCenterRows=ce(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(t,n,r)=>{const o=new Set([...n??[],...r??[]]);return t.filter(i=>!o.has(i.id))},ue(e.options,"debugRows","getCenterRows"))}},K$={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:qt("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>{var n;return e.setRowSelection(t?{}:(n=e.initialState.rowSelection)!=null?n:{})},e.toggleAllRowsSelected=t=>{e.setRowSelection(n=>{t=typeof t<"u"?t:!e.getIsAllRowsSelected();const r={...n},o=e.getPreGroupedRowModel().flatRows;return t?o.forEach(i=>{i.getCanSelect()&&(r[i.id]=!0)}):o.forEach(i=>{delete r[i.id]}),r})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{const r=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),o={...n};return e.getRowModel().rows.forEach(i=>{yf(o,i.id,r,!0,e)}),o}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=ce(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?Ku(e,n):{rows:[],flatRows:[],rowsById:{}},ue(e.options,"debugTable","getSelectedRowModel")),e.getFilteredSelectedRowModel=ce(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?Ku(e,n):{rows:[],flatRows:[],rowsById:{}},ue(e.options,"debugTable","getFilteredSelectedRowModel")),e.getGroupedSelectedRowModel=ce(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?Ku(e,n):{rows:[],flatRows:[],rowsById:{}},ue(e.options,"debugTable","getGroupedSelectedRowModel")),e.getIsAllRowsSelected=()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState();let r=!!(t.length&&Object.keys(n).length);return r&&t.some(o=>o.getCanSelect()&&!n[o.id])&&(r=!1),r},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter(o=>o.getCanSelect()),{rowSelection:n}=e.getState();let r=!!t.length;return r&&t.some(o=>!n[o.id])&&(r=!1),r},e.getIsSomeRowsSelected=()=>{var t;const n=Object.keys((t=e.getState().rowSelection)!=null?t:{}).length;return n>0&&n<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:t.filter(n=>n.getCanSelect()).some(n=>n.getIsSelected()||n.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(n,r)=>{const o=e.getIsSelected();t.setRowSelection(i=>{var s;if(n=typeof n<"u"?n:!o,e.getCanSelect()&&o===n)return i;const a={...i};return yf(a,e.id,n,(s=r?.selectChildren)!=null?s:!0,t),a})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return mg(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return vf(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return vf(e,n)==="all"},e.getCanSelect=()=>{var n;return typeof t.options.enableRowSelection=="function"?t.options.enableRowSelection(e):(n=t.options.enableRowSelection)!=null?n:!0},e.getCanSelectSubRows=()=>{var n;return typeof t.options.enableSubRowSelection=="function"?t.options.enableSubRowSelection(e):(n=t.options.enableSubRowSelection)!=null?n:!0},e.getCanMultiSelect=()=>{var n;return typeof t.options.enableMultiRowSelection=="function"?t.options.enableMultiRowSelection(e):(n=t.options.enableMultiRowSelection)!=null?n:!0},e.getToggleSelectedHandler=()=>{const n=e.getCanSelect();return r=>{var o;n&&e.toggleSelected((o=r.target)==null?void 0:o.checked)}}}},yf=(e,t,n,r,o)=>{var i;const s=o.getRow(t,!0);n?(s.getCanMultiSelect()||Object.keys(e).forEach(a=>delete e[a]),s.getCanSelect()&&(e[t]=!0)):delete e[t],r&&(i=s.subRows)!=null&&i.length&&s.getCanSelectSubRows()&&s.subRows.forEach(a=>yf(e,a.id,n,r,o))};function Ku(e,t){const n=e.getState().rowSelection,r=[],o={},i=function(s,a){return s.map(l=>{var c;const u=mg(l,n);if(u&&(r.push(l),o[l.id]=l),(c=l.subRows)!=null&&c.length&&(l={...l,subRows:i(l.subRows)}),u)return l}).filter(Boolean)};return{rows:i(t.rows),flatRows:r,rowsById:o}}function mg(e,t){var n;return(n=t[e.id])!=null?n:!1}function vf(e,t,n){var r;if(!((r=e.subRows)!=null&&r.length))return!1;let o=!0,i=!1;return e.subRows.forEach(s=>{if(!(i&&!o)&&(s.getCanSelect()&&(mg(s,t)?i=!0:o=!1),s.subRows&&s.subRows.length)){const a=vf(s,t);a==="all"?i=!0:(a==="some"&&(i=!0),o=!1)}}),o?"all":i?"some":!1}const xf=/([0-9]+)/gm,U$=(e,t,n)=>rS(Ur(e.getValue(n)).toLowerCase(),Ur(t.getValue(n)).toLowerCase()),G$=(e,t,n)=>rS(Ur(e.getValue(n)),Ur(t.getValue(n))),q$=(e,t,n)=>yg(Ur(e.getValue(n)).toLowerCase(),Ur(t.getValue(n)).toLowerCase()),Y$=(e,t,n)=>yg(Ur(e.getValue(n)),Ur(t.getValue(n))),X$=(e,t,n)=>{const r=e.getValue(n),o=t.getValue(n);return r>o?1:r<o?-1:0},Z$=(e,t,n)=>yg(e.getValue(n),t.getValue(n));function yg(e,t){return e===t?0:e>t?1:-1}function Ur(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function rS(e,t){const n=e.split(xf).filter(Boolean),r=t.split(xf).filter(Boolean);for(;n.length&&r.length;){const o=n.shift(),i=r.shift(),s=parseInt(o,10),a=parseInt(i,10),l=[s,a].sort();if(isNaN(l[0])){if(o>i)return 1;if(i>o)return-1;continue}if(isNaN(l[1]))return isNaN(s)?-1:1;if(s>a)return 1;if(a>s)return-1}return n.length-r.length}const ls={alphanumeric:U$,alphanumericCaseSensitive:G$,text:q$,textCaseSensitive:Y$,datetime:X$,basic:Z$},J$={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:qt("sorting",e),isMultiSortEvent:t=>t.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let r=!1;for(const o of n){const i=o?.getValue(e.id);if(Object.prototype.toString.call(i)==="[object Date]")return ls.datetime;if(typeof i=="string"&&(r=!0,i.split(xf).length>1))return ls.alphanumeric}return r?ls.text:ls.basic},e.getAutoSortDir=()=>{const n=t.getFilteredRowModel().flatRows[0];return typeof n?.getValue(e.id)=="string"?"asc":"desc"},e.getSortingFn=()=>{var n,r;if(!e)throw new Error;return mc(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(n=(r=t.options.sortingFns)==null?void 0:r[e.columnDef.sortingFn])!=null?n:ls[e.columnDef.sortingFn]},e.toggleSorting=(n,r)=>{const o=e.getNextSortingOrder(),i=typeof n<"u"&&n!==null;t.setSorting(s=>{const a=s?.find(h=>h.id===e.id),l=s?.findIndex(h=>h.id===e.id);let c=[],u,f=i?n:o==="desc";if(s!=null&&s.length&&e.getCanMultiSort()&&r?a?u="toggle":u="add":s!=null&&s.length&&l!==s.length-1?u="replace":a?u="toggle":u="replace",u==="toggle"&&(i||o||(u="remove")),u==="add"){var d;c=[...s,{id:e.id,desc:f}],c.splice(0,c.length-((d=t.options.maxMultiSortColCount)!=null?d:Number.MAX_SAFE_INTEGER))}else u==="toggle"?c=s.map(h=>h.id===e.id?{...h,desc:f}:h):u==="remove"?c=s.filter(h=>h.id!==e.id):c=[{id:e.id,desc:f}];return c})},e.getFirstSortDir=()=>{var n,r;return((n=(r=e.columnDef.sortDescFirst)!=null?r:t.options.sortDescFirst)!=null?n:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=n=>{var r,o;const i=e.getFirstSortDir(),s=e.getIsSorted();return s?s!==i&&((r=t.options.enableSortingRemoval)==null||r)&&(!(n&&(o=t.options.enableMultiRemove)!=null)||o)?!1:s==="desc"?"asc":"desc":i},e.getCanSort=()=>{var n,r;return((n=e.columnDef.enableSorting)!=null?n:!0)&&((r=t.options.enableSorting)!=null?r:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var n,r;return(n=(r=e.columnDef.enableMultiSort)!=null?r:t.options.enableMultiSort)!=null?n:!!e.accessorFn},e.getIsSorted=()=>{var n;const r=(n=t.getState().sorting)==null?void 0:n.find(o=>o.id===e.id);return r?r.desc?"desc":"asc":!1},e.getSortIndex=()=>{var n,r;return(n=(r=t.getState().sorting)==null?void 0:r.findIndex(o=>o.id===e.id))!=null?n:-1},e.clearSorting=()=>{t.setSorting(n=>n!=null&&n.length?n.filter(r=>r.id!==e.id):[])},e.getToggleSortingHandler=()=>{const n=e.getCanSort();return r=>{n&&(r.persist==null||r.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?t.options.isMultiSortEvent==null?void 0:t.options.isMultiSortEvent(r):!1))}}},createTable:e=>{e.setSorting=t=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var n,r;e.setSorting(t?[]:(n=(r=e.initialState)==null?void 0:r.sorting)!=null?n:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},Q$=[x$,j$,F$,$$,w$,C$,V$,B$,J$,P$,z$,H$,W$,K$,I$];function eO(e){var t,n;process.env.NODE_ENV!=="production"&&(e.debugAll||e.debugTable)&&console.info("Creating Table Instance...");const r=[...Q$,...(t=e._features)!=null?t:[]];let o={_features:r};const i=o._features.reduce((d,h)=>Object.assign(d,h.getDefaultOptions==null?void 0:h.getDefaultOptions(o)),{}),s=d=>o.options.mergeOptions?o.options.mergeOptions(i,d):{...i,...d};let l={...{},...(n=e.initialState)!=null?n:{}};o._features.forEach(d=>{var h;l=(h=d.getInitialState==null?void 0:d.getInitialState(l))!=null?h:l});const c=[];let u=!1;const f={_features:r,options:{...i,...e},initialState:l,_queue:d=>{c.push(d),u||(u=!0,Promise.resolve().then(()=>{for(;c.length;)c.shift()();u=!1}).catch(h=>setTimeout(()=>{throw h})))},reset:()=>{o.setState(o.initialState)},setOptions:d=>{const h=Pr(d,o.options);o.options=s(h)},getState:()=>o.options.state,setState:d=>{o.options.onStateChange==null||o.options.onStateChange(d)},_getRowId:(d,h,g)=>{var p;return(p=o.options.getRowId==null?void 0:o.options.getRowId(d,h,g))!=null?p:`${g?[g.id,h].join("."):h}`},getCoreRowModel:()=>(o._getCoreRowModel||(o._getCoreRowModel=o.options.getCoreRowModel(o)),o._getCoreRowModel()),getRowModel:()=>o.getPaginationRowModel(),getRow:(d,h)=>{let g=(h?o.getPrePaginationRowModel():o.getRowModel()).rowsById[d];if(!g&&(g=o.getCoreRowModel().rowsById[d],!g))throw process.env.NODE_ENV!=="production"?new Error(`getRow could not find row with ID: ${d}`):new Error;return g},_getDefaultColumnDef:ce(()=>[o.options.defaultColumn],d=>{var h;return d=(h=d)!=null?h:{},{header:g=>{const p=g.header.column.columnDef;return p.accessorKey?p.accessorKey:p.accessorFn?p.id:null},cell:g=>{var p,m;return(p=(m=g.renderValue())==null||m.toString==null?void 0:m.toString())!=null?p:null},...o._features.reduce((g,p)=>Object.assign(g,p.getDefaultColumnDef==null?void 0:p.getDefaultColumnDef()),{}),...d}},ue(e,"debugColumns","_getDefaultColumnDef")),_getColumnDefs:()=>o.options.columns,getAllColumns:ce(()=>[o._getColumnDefs()],d=>{const h=function(g,p,m){return m===void 0&&(m=0),g.map(x=>{const y=v$(o,x,m,p),v=x;return y.columns=v.columns?h(v.columns,y,m+1):[],y})};return h(d)},ue(e,"debugColumns","getAllColumns")),getAllFlatColumns:ce(()=>[o.getAllColumns()],d=>d.flatMap(h=>h.getFlatColumns()),ue(e,"debugColumns","getAllFlatColumns")),_getAllFlatColumnsById:ce(()=>[o.getAllFlatColumns()],d=>d.reduce((h,g)=>(h[g.id]=g,h),{}),ue(e,"debugColumns","getAllFlatColumnsById")),getAllLeafColumns:ce(()=>[o.getAllColumns(),o._getOrderColumnsFn()],(d,h)=>{let g=d.flatMap(p=>p.getLeafColumns());return h(g)},ue(e,"debugColumns","getAllLeafColumns")),getColumn:d=>{const h=o._getAllFlatColumnsById()[d];return process.env.NODE_ENV!=="production"&&!h&&console.error(`[Table] Column with id '${d}' does not exist.`),h}};Object.assign(o,f);for(let d=0;d<o._features.length;d++){const h=o._features[d];h==null||h.createTable==null||h.createTable(o)}return o}function tO(){return e=>ce(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(o,i,s){i===void 0&&(i=0);const a=[];for(let c=0;c<o.length;c++){const u=b$(e,e._getRowId(o[c],c,s),o[c],c,i,void 0,s?.id);if(n.flatRows.push(u),n.rowsById[u.id]=u,a.push(u),e.options.getSubRows){var l;u.originalSubRows=e.options.getSubRows(o[c],c),(l=u.originalSubRows)!=null&&l.length&&(u.subRows=r(u.originalSubRows,i+1,u))}}return a};return n.rows=r(t),n},ue(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex()))}function nO(e){const t=[],n=r=>{var o;t.push(r),(o=r.subRows)!=null&&o.length&&r.getIsExpanded()&&r.subRows.forEach(n)};return e.rows.forEach(n),{rows:t,flatRows:e.flatRows,rowsById:e.rowsById}}function rO(e){return t=>ce(()=>[t.getState().pagination,t.getPrePaginationRowModel(),t.options.paginateExpandedRows?void 0:t.getState().expanded],(n,r)=>{if(!r.rows.length)return r;const{pageSize:o,pageIndex:i}=n;let{rows:s,flatRows:a,rowsById:l}=r;const c=o*i,u=c+o;s=s.slice(c,u);let f;t.options.paginateExpandedRows?f={rows:s,flatRows:a,rowsById:l}:f=nO({rows:s,flatRows:a,rowsById:l}),f.flatRows=[];const d=h=>{f.flatRows.push(h),h.subRows.length&&h.subRows.forEach(d)};return f.rows.forEach(d),f},ue(t.options,"debugTable","getPaginationRowModel"))}function oO(){return e=>ce(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,n)=>{if(!n.rows.length||!(t!=null&&t.length))return n;const r=e.getState().sorting,o=[],i=r.filter(l=>{var c;return(c=e.getColumn(l.id))==null?void 0:c.getCanSort()}),s={};i.forEach(l=>{const c=e.getColumn(l.id);c&&(s[l.id]={sortUndefined:c.columnDef.sortUndefined,invertSorting:c.columnDef.invertSorting,sortingFn:c.getSortingFn()})});const a=l=>{const c=l.map(u=>({...u}));return c.sort((u,f)=>{for(let h=0;h<i.length;h+=1){var d;const g=i[h],p=s[g.id],m=p.sortUndefined,x=(d=g?.desc)!=null?d:!1;let y=0;if(m){const v=u.getValue(g.id),b=f.getValue(g.id),w=v===void 0,_=b===void 0;if(w||_){if(m==="first")return w?-1:1;if(m==="last")return w?1:-1;y=w&&_?0:w?m:-m}}if(y===0&&(y=p.sortingFn(u,f,g.id)),y!==0)return x&&(y*=-1),p.invertSorting&&(y*=-1),y}return u.index-f.index}),c.forEach(u=>{var f;o.push(u),(f=u.subRows)!=null&&f.length&&(u.subRows=a(u.subRows))}),c};return{rows:a(n.rows),flatRows:o,rowsById:n.rowsById}},ue(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex()))}function y0(e,t){return e?iO(e)?M.createElement(e,t):e:null}function iO(e){return sO(e)||typeof e=="function"||aO(e)}function sO(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function aO(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function lO(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=M.useState(()=>({current:eO(t)})),[r,o]=M.useState(()=>n.current.initialState);return n.current.setOptions(i=>({...i,...e,state:{...r,...e.state},onStateChange:s=>{o(s),e.onStateChange==null||e.onStateChange(s)}})),n.current}const cO=e=>M.createElement("svg",{width:32,height:32,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("style",null,`\r
73
- @keyframes spin {\r
74
- from {\r
75
- transform: rotate(0deg);\r
76
- }\r
77
- to {\r
78
- transform: rotate(360deg);\r
79
- }\r
80
- }\r
81
- .spinner {\r
82
- transform-origin: center;\r
83
- animation: spin 1s linear infinite;\r
84
- }\r
85
- `),M.createElement("g",{className:"spinner"},M.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M16.0003 6.83317C13.5692 6.83317 11.2376 7.79894 9.51851 9.51803C7.79943 11.2371 6.83366 13.5687 6.83366 15.9998C6.83366 18.431 7.79943 20.7626 9.51851 22.4817C11.2376 24.2007 13.5692 25.1665 16.0003 25.1665C18.4315 25.1665 20.7631 24.2007 22.4821 22.4817C24.2012 20.7626 25.167 18.431 25.167 15.9998C25.167 13.5687 24.2012 11.2371 22.4821 9.51803C20.7631 7.79894 18.4315 6.83317 16.0003 6.83317ZM3.16699 15.9998C3.16699 8.91217 8.91266 3.1665 16.0003 3.1665C23.088 3.1665 28.8337 8.91217 28.8337 15.9998C28.8337 23.0875 23.088 28.8332 16.0003 28.8332C8.91266 28.8332 3.16699 23.0875 3.16699 15.9998Z",fill:"currentColor",fillOpacity:.12}),M.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.9997 6.83319C13.6363 6.82787 11.3633 7.74068 9.65999 9.37907C9.30711 9.70535 8.84021 9.88001 8.35982 9.86545C7.87943 9.85089 7.42396 9.64827 7.09149 9.30122C6.75902 8.95416 6.57612 8.49043 6.58218 8.00985C6.58823 7.52928 6.78276 7.07031 7.12388 6.73174C9.50956 4.43941 12.6912 3.16143 15.9997 3.16652C16.4859 3.16652 16.9522 3.35967 17.296 3.70349C17.6398 4.04731 17.833 4.51362 17.833 4.99985C17.833 5.48608 17.6398 5.9524 17.296 6.29621C16.9522 6.64003 16.4859 6.83319 15.9997 6.83319Z",fill:"currentColor"}))),uO=e=>M.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("g",{clipPath:"url(#clip0_2074_3858)"},M.createElement("path",{d:"M21 21L16.65 16.65M19 11C19 15.4183 15.4183 19 11 19C6.58172 19 3 15.4183 3 11C3 6.58172 6.58172 3 11 3C15.4183 3 19 6.58172 19 11Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),M.createElement("defs",null,M.createElement("clipPath",{id:"clip0_2074_3858"},M.createElement("rect",{width:24,height:24,fill:"white"})))),dO={table:R.css({...me.body2,fontWeight:500})},oS=S.forwardRef(({children:e,className:t,style:n,...r},o)=>C.jsx("td",{ref:o,className:R.cx(t),style:n,...r,children:e}));oS.displayName="TableBodyCell";const{spacing:v0}=j,iS=S.forwardRef(({children:e,row:t=!0,justifyContent:n="flex-start",alignItems:r="center",py:o=v0.sm,px:i=v0.md,minHeight:s="56px",...a},l)=>C.jsx(G,{row:t,justifyContent:n,alignItems:r,py:o,px:i,minHeight:s,ref:l,...a,children:e}));iS.displayName="TableBodyCellContent";const{color:fO}=j,sS=S.forwardRef(({children:e,className:t,showBorders:n=!1,isSelected:r=!1,...o},i)=>{const s=R.css({borderBottom:n?`1px solid ${fO.border.neutralAlphaLow}`:"none"});return C.jsx("tr",{ref:i,className:R.cx(s,t),...o,children:e})});sS.displayName="TableBodyRow";const hO=S.forwardRef(({children:e,className:t,style:n,justifyContent:r="flex-start",alignItems:o="flex-start",...i},s)=>{const a=R.css({justifyContent:r,alignItems:o,fontWeight:"inherit"});return C.jsx("th",{ref:s,className:R.cx(a,t),style:n,...i,children:e})}),{spacing:x0}=j,vg=S.forwardRef(({children:e,row:t=!0,justifyContent:n="flex-start",alignItems:r="center",py:o=x0.sm,px:i=x0.md,minHeight:s="56px",...a},l)=>C.jsx(G,{row:t,justifyContent:n,alignItems:r,py:o,px:i,minHeight:s,ref:l,...a,children:e}));vg.displayName="TableHeadCellContent";const gO=e=>M.createElement("svg",{width:10,height:6,viewBox:"0 0 10 6",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("path",{d:"M8.75 0.75L4.75 4.75L0.75 0.75",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),pO=e=>M.createElement("svg",{width:10,height:6,viewBox:"0 0 10 6",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("path",{d:"M8.75 4.75L4.75 0.75L0.75 4.75",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),{color:Ba}=j,mO=({sortDirection:e,gap:t="5px",...n})=>C.jsxs(G,{gap:t,...n,children:[C.jsx(pO,{style:{color:e==="asc"?Ba.icon.accent:Ba.icon.tertiary}}),C.jsx(gO,{style:{color:e==="desc"?Ba.icon.accent:Ba.icon.tertiary}})]}),aS=({children:e,tableProps:t,gap:n="10px",...r})=>{const o=t.column.getIsSorted();return C.jsxs(vg,{style:{cursor:"pointer",userSelect:"none"},gap:n,...r,children:[e,C.jsx(mO,{sortDirection:o})]})};aS.displayName="TableHeadCellContentSortable";const{color:b0}=j,lS=S.forwardRef(({children:e,className:t,showBorders:n=!1,...r},o)=>{const i=R.css({backgroundColor:b0.fill.bgSecondary,borderBottom:n?`1px solid ${b0.border.neutralAlphaLow}`:"none"});return C.jsx("tr",{ref:o,className:R.cx(i,t),...r,children:e})});lS.displayName="TableHeadRow";const yO=e=>M.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("path",{d:"M15 18L9 12L15 6",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),vO=e=>M.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("path",{d:"M9 18L15 12L9 6",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),xO=e=>M.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("path",{d:"M12 13C12.5523 13 13 12.5523 13 12C13 11.4477 12.5523 11 12 11C11.4477 11 11 11.4477 11 12C11 12.5523 11.4477 13 12 13Z",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),M.createElement("path",{d:"M19 13C19.5523 13 20 12.5523 20 12C20 11.4477 19.5523 11 19 11C18.4477 11 18 11.4477 18 12C18 12.5523 18.4477 13 19 13Z",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),M.createElement("path",{d:"M5 13C5.55228 13 6 12.5523 6 12C6 11.4477 5.55228 11 5 11C4.44772 11 4 11.4477 4 12C4 12.5523 4.44772 13 5 13Z",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),Uu=(e,t)=>{const n=t-e+1;return Array.from({length:n},(r,o)=>e+o)};function bO(e){const{count:t=1,page:n,maxVisiblePages:r=10}=e;let o=1,i=1;if(r<=2)return[n];r<=4?(o=0,i=0):r<=6?(o=1,i=0):r<=7?(o=1,i=Math.max(0,Math.floor((r-4)/2))):(o=1,i=Math.max(1,Math.floor((r-5)/2)));const s=Uu(1,Math.min(o,t)),a=Uu(Math.max(t-o+1,o+1),t),l=Math.max(Math.min(n-i,t-o-i*2-1),o+2),c=Math.min(Math.max(n+i,o+i*2+2),t-o-1);return[...s,...l>o+2?["start-dots"]:o+1<t-o?[o+1]:[],...Uu(l,c),...c<t-o-1?["end-dots"]:t-o>o?[t-o]:[],...a]}const{color:Zo,cornerRadius:wO,spacing:w0}=j,CO=({pageIndex:e,pageSize:t,totalCount:n,onPageChange:r,onPageSizeChange:o,pageSizeOptions:i=[10,20,50,100],showPageSizeSelector:s=!0,renderPageSizeSelectorDropdownItem:a=c=>c.label,renderPageSizeSelectorInputItem:l})=>{const c=S.useRef(null),[u,f]=S.useState(0),d=Math.ceil(n/t),h=e>0,g=e<d-1;S.useEffect(()=>{const w=c.current;if(!w)return;const _=new ResizeObserver(E=>{for(const T of E)f(T.contentRect.width)});return _.observe(w),()=>{_.disconnect()}},[]);const m=(w=>{if(w<=0)return 1;const P=w-96;if(P<=40)return 1;const O=Math.floor((P+8)/48);return Math.max(1,Math.min(10,O))})(u),x=bO({page:e+1,count:d,maxVisiblePages:m}),y=()=>{h&&r(e-1)},v=()=>{g&&r(e+1)},b=w=>{o(Number(w))};return n===0?null:C.jsxs(G,{flex:1,row:!0,justifyContent:"space-between",children:[C.jsxs(G,{ref:c,flex:1,row:!0,overflow:"hidden",gap:w0.sm,children:[C.jsx(fr,{onClick:y,disabled:!h,color:"neutral",size:"sm",children:C.jsx(yO,{})}),C.jsx(G,{row:!0,gap:w0.sm,children:x.map(w=>C.jsx(SO,{isDots:w==="start-dots"||w==="end-dots",isCurrentPage:w===e+1,disabled:w==="start-dots"||w==="end-dots",onClick:()=>r(w-1),children:w},w))}),C.jsx(fr,{color:"neutral",size:"sm",onClick:v,disabled:!g,children:C.jsx(vO,{})})]}),s&&C.jsx(G,{alignItems:"flex-end",children:C.jsx(gg,{width:"fit-content",value:t.toString(),size:"sm",items:i.map(w=>({value:w.toString(),label:w.toString()})),returnedValue:w=>w.value,renderDropdownItem:a,renderSingleInputItem:l,onChange:w=>b(w)})})]})},SO=({children:e,isCurrentPage:t=!1,onClick:n,isDots:r=!1,disabled:o=!1})=>{const i=R.css({cursor:o?"not-allowed":"pointer",userSelect:"none",width:"40px",height:"40px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:t?Zo.fill.accentSecondary:Zo.fill.bgSecondary,borderRadius:wO.sm,border:t?`1px solid ${Zo.fill.accentSecondaryHover}`:`1px solid ${Zo.border.neutralAlphaBasic}`}),s=R.css({width:"24px",height:"24px",color:t?Zo.icon.secondary:Zo.icon.tertiary});return C.jsx(G,{className:i,onClick:o?void 0:n,children:r?C.jsx(xO,{className:s}):C.jsx(se,{center:!0,variant:"body-2",fontWeight:"medium",children:e})})},{color:bf,cornerRadius:_O}=j,TO=R.css({position:"relative",borderRadius:_O.md,overflow:"hidden","&::before, &::after":{content:'""',position:"absolute",top:0,bottom:14,width:96,pointerEvents:"none",zIndex:1,transition:"opacity 0.2s ease"},"&::before":{left:0,background:"linear-gradient(to left, rgba(255, 255, 255, 0.00) 0%, #FFF 100%)"},"&::after":{right:0,background:"linear-gradient(to right, rgba(255, 255, 255, 0.00) 0%, #FFF 100%)"}}),EO=R.css({overflowX:"auto",scrollbarWidth:"thin",scrollbarColor:`${bf.scrollbar.thumbPrimary} ${bf.scrollbar.trackPrimary}`}),cS=S.memo(({data:e,children:t,className:n,showBorders:r=!1,...o})=>{const[i,s]=S.useState(!1),[a,l]=S.useState(!1),c=S.useRef(null),u=S.useCallback(()=>{const d=c.current;if(!d)return;const{scrollLeft:h,scrollWidth:g,clientWidth:p}=d,m=g>p;s(m&&h>0),l(m&&h<g-p-1)},[]);S.useEffect(()=>{const d=c.current;if(!d)return;u();const h=new ResizeObserver(u);return h.observe(d),d.addEventListener("scroll",u),()=>{h.disconnect(),d.removeEventListener("scroll",u)}},[u,e]);const f=R.css({border:r?`1px solid ${bf.border.neutralAlphaLow}`:"transparent","&::before":{opacity:i?1:0},"&::after":{opacity:a?1:0}});return C.jsx(G,{className:R.cx(TO,f,n),...o,children:C.jsx(G,{ref:c,className:EO,children:t})})});cS.displayName="TableWrapper";const{spacing:mn,cornerRadius:C0,color:Bs}=j,RO=R.css({width:"100%",maxWidth:"100%",minWidth:"max-content",borderCollapse:"collapse",borderSpacing:0,backgroundColor:Bs.fill.bgPrimary}),kO=R.css({backgroundColor:Bs.fill.bgSecondary,color:Bs.text.tertiary}),qi=({ref:e,data:t,columns:n,showBorders:r=!0,enableSorting:o=!1,enablePagination:i=!1,enableRowSelection:s=!1,enableMultiRowSelection:a=!1,sorting:l,onSortingChange:c,columnFilters:u,onColumnFiltersChange:f,columnVisibility:d,onColumnVisibilityChange:h,pagination:g,onPaginationChange:p,rowSelection:m,onRowSelectionChange:x,totalCount:y,loading:v=!1,emptyLabels:b={title:"Nothing found",description:"No results found for “result”",action:"Reset"},loadingLabels:w={title:"Loading...",description:"Please wait or reset your promt",action:"Reset"},className:_,containerClassName:E,tableOptions:T={},onRowClick:k,getRowId:P,headCellComponent:O=hO,bodyCellComponent:D=oS,headRowComponent:I=lS,bodyRowComponent:$=sS,onReset:H,renderPageSizeSelectorDropdownItem:U,renderPageSizeSelectorInputItem:L})=>{const[N,V]=S.useState([]),[K,te]=S.useState([]),[J,Z]=S.useState({}),[ae,oe]=S.useState({pageIndex:0,pageSize:10}),[fe,Te]=S.useState({}),ne=l??N,ve=u??K,Ee=d??J,De=g??ae,st=m??fe,ee=xe=>{const Me=typeof xe=="function"?xe(ne):xe;c?c(Me):V(Me)},Ce=xe=>{const Me=typeof xe=="function"?xe(ve):xe;f?f(Me):te(Me)},ze=xe=>{const Me=typeof xe=="function"?xe(Ee):xe;h?h(Me):Z(Me)},Re=xe=>{const Me=typeof xe=="function"?xe(De):xe;p?p(Me):oe(Me)},Ft=lO({data:t,columns:n,state:{sorting:ne,columnFilters:ve,columnVisibility:Ee,pagination:De,rowSelection:st},onSortingChange:ee,onColumnFiltersChange:Ce,onColumnVisibilityChange:ze,onPaginationChange:Re,onRowSelectionChange:xe=>{const Me=typeof xe=="function"?xe(st):xe;x?x(Me):Te(Me)},getCoreRowModel:tO(),getSortedRowModel:o?oO():void 0,getPaginationRowModel:i?rO():void 0,enableRowSelection:s,enableMultiRowSelection:a,getRowId:P,manualPagination:!!y,pageCount:y?Math.ceil(y/De.pageSize):void 0,...T});S.useImperativeHandle(e,()=>Ft);const{rows:Yt}=Ft.getRowModel(),Xt=(xe,Me)=>{k&&k(xe.original,Me)};return v?C.jsxs(G,{w:"full",borderRadius:C0.md,py:mn["5xl"],px:mn["10xl"],alignItems:"center",className:R.cx(E),children:[C.jsx(cO,{width:32,height:32,style:{color:Bs.icon.tertiary,marginBottom:mn.sm}}),C.jsx(se,{mb:mn.xs,variant:"title-3",fontWeight:"semibold",children:w.title}),C.jsx(se,{mb:mn.md,colorName:"tertiary",variant:"body-1",fontWeight:"medium",children:w.description}),typeof w.action=="string"?C.jsx(Ti,{width:"auto",onClick:H,intensity:"secondary",color:"accent",children:w.action}):w.action]}):Yt.length?C.jsxs(G,{w:"full",gap:mn.xl,className:R.cx(E),children:[C.jsx(cS,{data:t,showBorders:r,children:C.jsxs("table",{className:R.cx(RO,dO.table,_),children:[C.jsx("thead",{className:kO,children:Ft.getHeaderGroups().map(xe=>C.jsx(I,{showBorders:r,children:xe.headers.map(Me=>C.jsx(O,{style:{width:Me.getSize()},onClick:Me.column.getToggleSortingHandler(),children:Me.isPlaceholder?null:y0(Me.column.columnDef.header,Me.getContext())},Me.id))},xe.id))}),C.jsx("tbody",{children:Yt.map((xe,Me)=>C.jsx($,{showBorders:r,isSelected:xe.getIsSelected(),onClick:()=>Xt(xe,Me),children:xe.getVisibleCells().map(Zt=>C.jsx(D,{children:y0(Zt.column.columnDef.cell,Zt.getContext())},Zt.id))},xe.id))})]})}),i&&!v&&C.jsx(CO,{pageIndex:De.pageIndex,pageSize:De.pageSize,totalCount:y||t.length,renderPageSizeSelectorDropdownItem:U,renderPageSizeSelectorInputItem:L,onPageChange:xe=>Re({...De,pageIndex:xe}),onPageSizeChange:xe=>Re({...De,pageSize:xe,pageIndex:0})})]}):C.jsxs(G,{w:"full",borderRadius:C0.md,py:mn["5xl"],px:mn["10xl"],alignItems:"center",className:R.cx(E),children:[C.jsx(uO,{width:24,height:24,style:{color:Bs.icon.tertiary,marginBottom:mn.sm}}),C.jsx(se,{mb:mn.xs,variant:"title-3",fontWeight:"semibold",children:b.title}),C.jsx(se,{mb:mn.md,colorName:"tertiary",variant:"body-1",fontWeight:"medium",children:b.description}),typeof b.action=="string"?C.jsx(Ti,{width:"auto",onClick:H,intensity:"secondary",color:"accent",children:b.action}):b.action]})};qi.displayName="Table";qi.HeadCellContent=vg;qi.BodyCellContent=iS;qi.HeadCellContentSortable=aS;qi.createColumnHelper=qC;const{color:tn}=j,Gu={chart:{type:"areaspline",backgroundColor:"transparent",spacing:[0,0,0,0],margin:[0,0,0,0]},xAxis:{gridLineWidth:0,lineWidth:0,tickWidth:0,labels:{enabled:!1},title:{text:""}},yAxis:{gridLineWidth:0,lineWidth:0,tickWidth:0,labels:{enabled:!1},title:{text:""}},legend:{enabled:!1},credits:{enabled:!1}},AO={positive:{color:tn.fill.positivePrimary,fillColor:{linearGradient:{x1:0,y1:0,x2:0,y2:1},stops:[[0,tn.fill.positiveTintHigh],[1,tn.fill.positiveTransparent]]}},negative:{color:tn.fill.negativePrimary,fillColor:{linearGradient:{x1:0,y1:0,x2:0,y2:1},stops:[[0,tn.fill.negativeTintHigh],[1,tn.fill.negativeTransparent]]}},accent:{color:tn.fill.accentPrimary,fillColor:{linearGradient:{x1:0,y1:0,x2:0,y2:1},stops:[[0,tn.fill.accentTintHigh],[1,tn.fill.accentTransparent]]}},warning:{color:tn.fill.warningPrimary,fillColor:{linearGradient:{x1:0,y1:0,x2:0,y2:1},stops:[[0,tn.fill.warningTintHigh],[1,tn.fill.warningTransparent]]}},transfer:{color:"var(--fill-transfer-primary)",fillColor:{linearGradient:{x1:0,y1:0,x2:0,y2:1},stops:[[0,"var(--fill-transfer-tint-high)"],[1,"var(--fill-transfer-transparent)"]]}}},{color:S0}=j,MO=(e,t,n,r,o)=>({...Gu,plotOptions:{areaspline:{marker:{enabled:!1,states:{hover:{enabled:o}}},allowPointSelect:!1}},xAxis:{...Gu.xAxis,...n},yAxis:{...Gu.yAxis,...r},series:[{type:"areaspline",data:t,...AO[e]}]}),NO=e=>({outside:!0,enabled:!!e,padding:0,position:{alignByTranslate:!0},shadow:{color:S0.effect.shadowM,offsetX:0,offsetY:0},borderRadius:8,backgroundColor:S0.fill.bgPrimary,useHTML:!0,...e}),uS=({color:e="positive",data:t=[],xAxis:n,yAxis:r,containerProps:o,highcharts:i,tooltip:s})=>{const a=S.useRef(null);S.useEffect(()=>()=>{typeof a=="object"&&a?.current?.chart&&a.current.chart.destroy()},[]);const l=S.useMemo(()=>MO(e,t,n,r,!!s),[e,t,n,r,s]),c=S.useMemo(()=>s?NO(s):{enabled:!1},[s]);return C.jsx(il.Chart,{highcharts:i,ref:a,options:l,containerProps:o,children:C.jsx(il.Tooltip,{...c})})};uS.displayName="LineChart";const{color:nr}=j,PO={chart:{type:"pie",backgroundColor:"transparent",spacing:[0,0,0,0],margin:[0,0,0,0],events:{click:void 0}},title:{align:"center",verticalAlign:"middle",floating:!0,style:{fontSize:"24px",fontWeight:"600",color:nr.text.primary}},plotOptions:{pie:{allowPointSelect:!0,cursor:"pointer",dataLabels:{enabled:!1},startAngle:90,endAngle:-90,innerSize:"90%",borderWidth:0,states:{hover:{enabled:!1},select:{enabled:!1},inactive:{enabled:!1}},enableMouseTracking:!1}},tooltip:{enabled:!1},legend:{enabled:!1},credits:{enabled:!1}},LO={positive:{colors:[nr.fill.positivePrimary,nr.fill.positiveTintHigh]},negative:{colors:[nr.fill.negativePrimary,nr.fill.negativeTintHigh]},accent:{colors:[nr.fill.accentPrimary,nr.fill.accentTintHigh]},warning:{colors:[nr.fill.warningPrimary,nr.fill.warningTintHigh]},transfer:{colors:["var(--fill-transfer-primary)","var(--fill-transfer-tint-high)"]}},FO=(e,t)=>({...PO,series:[{type:"pie",data:[{name:"",y:Math.min(e,100)},{name:"",y:Math.max(100-e,0)}],...LO[t]}]}),dS=S.forwardRef(({highcharts:e,color:t="positive",percentage:n,label:r=s=>`${s}%`,containerProps:o},i)=>{const s=S.useRef(null),a=i||s;S.useEffect(()=>()=>{typeof a=="object"&&a?.current?.chart&&a.current.chart.destroy()},[a]);const l=S.useMemo(()=>FO(n,t),[n,t]);return C.jsx(il.Chart,{highcharts:e,ref:a,options:l,containerProps:o,children:C.jsx(il.Title,{children:r?.(n)})})});dS.displayName="PieProgressChart";const $O=e=>M.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("path",{d:"M9 17L14 12L9 7",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),{color:_0}=j,rl={link:R.css({...me.body2,color:_0.text.tertiary,textDecoration:"none",transition:"color 0.2s ease","&:hover":{textDecoration:"underline"}}),separator:R.css({color:_0.icon.tertiary}),nav:R.css({display:"flex",alignItems:"center",flexWrap:"wrap"}),navItem:R.css({display:"inline-flex",alignItems:"center"})},xg=({children:e,separator:t=C.jsx($O,{className:rl.separator})})=>{const n=S.Children.toArray(e).filter(r=>S.isValidElement(r));return C.jsx("nav",{"aria-label":"breadcrumb",className:rl.nav,children:n.map((r,o)=>{const i=o===n.length-1;return C.jsxs(se,{tag:"span",className:rl.navItem,children:[S.cloneElement(r,{active:r.props.active??i}),!i&&t]},o)})})},OO=({children:e,href:t,active:n,className:r,activeClassName:o,activeElement:i,onClick:s})=>n?i||C.jsx(se,{tag:"span",variant:"body-2",fontWeight:"medium",colorName:"primary",className:R.cx(r,o),onClick:s,children:e}):C.jsx("a",{href:t,className:R.cx(rl.link,r),onClick:s,children:e});xg.Item=OO;xg.displayName="Breadcrumbs";const IO=xg,{color:Je,cornerRadius:Sr,height:xt,transition:T0}=j,DO={primary:{bg:Je.fill.accentTint,text:Je.text.accent,icon:Je.icon.accent},secondary:{bg:Je.fill.neutralTint,text:Je.text.secondary,icon:Je.icon.tertiary},negative:{bg:Je.fill.negativeTint,text:Je.text.negative,icon:Je.icon.negative},positive:{bg:Je.fill.positiveTint,text:Je.text.positive,icon:Je.icon.positive},warning:{bg:Je.fill.warningTint,text:Je.text.warning,icon:Je.icon.warning},neutral:{bg:Je.fill.neutralTint,text:Je.text.tertiary,icon:Je.icon.tertiary},transfer:{bg:"var(--fill-transfer-tint)",text:"var(--text-transfer)",icon:"var(--icon-transfer)"},custom:{bg:Je.fill.accentTint,text:Je.text.accent,icon:Je.icon.accent}},jO={"2xs":{size:xt.avatar["2xs"],borderRadius:Sr.xs,iconSize:xt.icon["2xs"],fontSize:10,fontWeight:"var(--fw-medium)"},xs:{size:xt.avatar.xs,borderRadius:Sr.sm,iconSize:xt.icon.xs,fontSize:12,fontWeight:"var(--fw-medium)"},sm:{size:xt.avatar.sm,borderRadius:Sr.sm,iconSize:xt.icon.xs,fontSize:14,fontWeight:"var(--fw-medium)"},md:{size:xt.avatar.md,borderRadius:Sr.sm,iconSize:xt.icon.sm,fontSize:14,fontWeight:"var(--fw-medium)"},lg:{size:xt.avatar.lg,borderRadius:Sr.md,iconSize:xt.icon.md,fontSize:16,fontWeight:"var(--fw-semibold)"},xl:{size:xt.avatar.xl,borderRadius:Sr.md,iconSize:xt.icon.md,fontSize:16,fontWeight:"var(--fw-semibold)"},"2xl":{size:xt.avatar["2xl"],borderRadius:Sr.md,iconSize:xt.icon.md,fontSize:18,fontWeight:"var(--fw-semibold)"},custom:{size:xt.avatar.md,borderRadius:Sr.sm,iconSize:xt.icon.sm,fontSize:14,fontWeight:"var(--fw-medium)"}},fS=S.forwardRef(({children:e,color:t="primary",size:n="md",fullRound:r=!1,className:o},i)=>{const s=S.useMemo(()=>DO[t],[t]),a=S.useMemo(()=>jO[n],[n]),l=S.useMemo(()=>R.css({width:a.size,height:a.size,borderRadius:r?"var(--corner-full-round)":a.borderRadius,backgroundColor:s.bg,color:s.text,fontSize:a.fontSize,fontWeight:a.fontWeight,lineHeight:1,transition:T0.general,"& svg":{width:a.iconSize,height:a.iconSize,color:s.icon,transition:T0.general},"& img":{width:"100%",height:"100%",objectFit:"cover"},"&:has(img)":{backgroundColor:"transparent",border:`1px solid ${Je.border.neutralAlphaLow}`}}),[s,a,r]);return C.jsx(G,{ref:i,center:!0,overflow:"hidden",className:R.cx(l,o),children:e})});fS.displayName="Avatar";const{color:Tt,cornerRadius:qu,spacing:ol}=j,wf={neutral:{border:Tt.border.neutralAlphaLow,bg:Tt.status.neutralTint,color:Tt.text.secondary,colorName:"secondary"},accent:{border:Tt.border.accentSecondary,bg:Tt.status.accentTintLow,color:Tt.text.accent,colorName:"accent"},warning:{border:Tt.border.warningSecondary,bg:Tt.status.warningTintLow,color:Tt.text.warning,colorName:"warning"},positive:{border:Tt.border.positiveSecondary,bg:Tt.status.positiveTintLow,color:Tt.text.positive,colorName:"positive"},negative:{border:Tt.border.negativeSecondary,bg:Tt.status.negativeTintLow,color:Tt.text.negative,colorName:"negative"},transfer:{border:"var(--border-transfer-secondary)",bg:"var(--status-transfer-tint-low)",color:"var(--text-transfer)",colorName:"transfer"}},za={sm:{h:24,text:"caption-1",corner:qu.xs,p:`6px ${ol.sm}`},md:{h:32,text:"body-2",corner:qu.sm,p:`6px ${ol.md}`},lg:{h:40,text:"body-2",corner:qu.md,p:`6px ${ol.lg}`}},VO=(e,t,n,r)=>{const o=wf[t];let i=o.bg,s="none";const a=o.color;switch(e){case"outline":i="transparent",s=`1px solid ${o.border}`;break;case"clear":i="transparent";break;default:i=o.bg;break}return R.css({cursor:n?"not-allowed":r?"pointer":"default",opacity:n?.5:1,userSelect:"none",position:"relative",transition:"background-color 0.2s, opacity 0.2s",backgroundColor:i,color:a,border:s})},BO=R.css({display:"inline-flex",cursor:"pointer",opacity:.6,"&:hover":{opacity:1}}),hS=({label:e,color:t="neutral",size:n="md",variant:r="filled",leftElement:o,rightElement:i,disabled:s,onClick:a,onDelete:l,className:c})=>{const u=VO(r,t,s,a);return C.jsxs(G,{row:!0,alignItems:"center",gap:ol.sm,p:za[n].p,h:za[n].h,overflow:"hidden",borderRadius:za[n].corner,onClick:a,className:R.cx(u,c),children:[a&&C.jsx($o,{}),o,C.jsx(se,{variant:za[n].text,colorName:wf[t].colorName,textOverflow:"ellipsis",children:e}),i,l&&!s&&C.jsx(se,{className:BO,colorName:wf[t].colorName,onClick:f=>{f.stopPropagation(),l(f)},children:C.jsx(jC,{})})]})};hS.displayName="Badge";const zO=e=>M.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("circle",{cx:12,cy:12,r:10,fill:"currentColor",fillOpacity:.15}),M.createElement("path",{d:"M16 9L10.0337 15L8 12.9548",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),Yu=e=>M.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("path",{d:"M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12Z",fill:"currentColor",fillOpacity:.15}),M.createElement("path",{d:"M12 6C11.4477 6 11 6.44772 11 7V13C11 13.5523 11.4477 14 12 14C12.5523 14 13 13.5523 13 13V7C13 6.44772 12.5523 6 12 6Z",fill:"currentColor"}),M.createElement("path",{d:"M12 15C11.4477 15 11 15.4477 11 16V17C11 17.5523 11.4477 18 12 18C12.5523 18 13 17.5523 13 17V16C13 15.4477 12.5523 15 12 15Z",fill:"currentColor"})),HO=e=>M.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("circle",{cx:12,cy:12,r:10,fill:"currentColor",fillOpacity:.12}),M.createElement("path",{d:"M16 8L8 16M16 16L8 8",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round"})),WO=e=>M.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:"currentColor",...e},M.createElement("path",{d:"M12 2V22M19.0711 4.92893L4.92893 19.0711M22 12H2M19.0711 19.0711L4.92893 4.92893",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),{color:Ke,cornerRadius:KO,spacing:Es}=j,Jo={hint:R.css({display:"flex",alignItems:"flex-start",gap:Es.md,padding:Es.lg,minHeight:48,width:"100%",borderRadius:KO.md,transition:"background 0.2s, color 0.2s"}),icon:R.css({flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center","& svg":{width:24,height:24}}),content:R.css({display:"flex",flexDirection:"column",gap:Es.xs}),title:R.css({verticalAlign:"middle",color:"inherit"}),subtitle:R.css({verticalAlign:"middle",opacity:.8,color:"inherit"}),disabled:R.css({opacity:.5,pointerEvents:"none"})},UO={solid:{warning:R.css({background:Ke.status.warning,color:Ke.text.inverse}),negative:R.css({background:Ke.status.negative,color:Ke.text.inverse}),positive:R.css({background:Ke.status.positive,color:Ke.text.inverse}),accent:R.css({background:Ke.status.accent,color:Ke.text.inverse}),neutral:R.css({background:Ke.status.neutral,color:Ke.text.inverse}),transfer:R.css({background:Ke.status.transfer,color:Ke.text.inverse})},soft:{warning:R.css({background:Ke.status.warningTintLow,color:Ke.text.warning}),negative:R.css({background:Ke.status.negativeTintLow,color:Ke.text.negative}),positive:R.css({background:Ke.status.positiveTintLow,color:Ke.text.positive}),accent:R.css({background:Ke.status.accentTintLow,color:Ke.text.accent}),neutral:R.css({background:Ke.status.neutralTintLow,color:Ke.text.tertiary}),transfer:R.css({background:Ke.status.transferTintLow,color:Ke.text.transfer})}},GO={md:R.css({minHeight:48,padding:Es.lg}),sm:R.css({minHeight:32,padding:Es.md})},qO={negative:C.jsx(HO,{}),positive:C.jsx(zO,{}),accent:C.jsx(Yu,{}),warning:C.jsx(Yu,{}),transfer:C.jsx(Yu,{}),neutral:C.jsx(WO,{})},YO=({title:e,subtitle:t,color:n="warning",variant:r="soft",size:o="md",icon:i,disabled:s=!1,className:a,style:l})=>{const c=i||qO[n];return C.jsxs("div",{className:Tf(Jo.hint,GO[o],UO[r][n],s&&Jo.disabled,a),style:l,"aria-disabled":s,children:[c&&C.jsx("span",{className:Jo.icon,children:c}),C.jsxs("div",{className:Jo.content,children:[e&&C.jsx(se,{className:Jo.title,variant:o==="md"?"body-1":"caption-2",children:e}),t&&C.jsx(se,{className:Jo.subtitle,variant:o==="md"?"body-2":"caption-1",children:t})]})]})},{color:ro,cornerRadius:XO,spacing:Ln}=j,ZO=R.css({width:"100%",cursor:"default",userSelect:"text",outline:"none",...me.body2,color:ro.text.primary,overflowWrap:"anywhere","p, ul, ol, pre, blockquote, table":{margin:`${Ln.sm} 0`},"h1, h2, h3, h4, h5, h6":{margin:`${Ln.md} 0 ${Ln.sm}`,fontWeight:600},h1:{fontSize:me.title1.fontSize,lineHeight:me.title1.lineHeight},h2:{fontSize:me.title2.fontSize,lineHeight:me.title2.lineHeight},h3:{fontSize:me.title3.fontSize,lineHeight:me.title3.lineHeight},h4:{fontSize:me.headline2.fontSize,lineHeight:me.headline2.lineHeight},h5:{fontSize:me.headline3.fontSize,lineHeight:me.headline3.lineHeight},h6:{fontSize:me.body1.fontSize,lineHeight:me.body1.lineHeight},ul:{paddingLeft:Ln.xl,listStyleType:"disc"},ol:{paddingLeft:Ln.xl,listStyleType:"decimal"},li:{margin:`${Ln.xs} 0`},a:{color:ro.text.accent,textDecoration:"underline"},code:{padding:`0 ${Ln.xs}`,borderRadius:XO.xs,backgroundColor:ro.fill.neutralSecondary,fontFamily:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace'},"pre code":{display:"block",padding:Ln.md,overflowX:"auto"},blockquote:{marginLeft:0,paddingLeft:Ln.md,borderLeft:`3px solid ${ro.border.neutralAlphaBasic}`,color:ro.text.secondary},table:{width:"100%",borderCollapse:"collapse"},"th, td":{border:`1px solid ${ro.border.neutralAlphaBasic}`,padding:Ln.sm,textAlign:"left"},th:{backgroundColor:ro.fill.neutralSecondary}});function JO({markdown:e,className:t,emptyState:n=null}){const r=e.trim(),o=S.useMemo(()=>({isEditable:!1,isPreviewMode:!0,setPreviewMode:()=>{},markdownText:r}),[r]);return r?C.jsx(sh.Provider,{value:o,children:C.jsx(Ww,{initialConfig:{...mC(),editable:!1,namespace:"ui-kit-markdown-text-viewer",editorState:()=>{zw(r,Fl)}},children:C.jsx(pC,{contentEditable:C.jsx(hC,{className:R.cx(ZO,t),"aria-placeholder":"markdown text",placeholder:()=>null}),placeholder:null,ErrorBoundary:gC})},r)}):typeof n=="string"?C.jsx(se,{variant:"body-2",colorName:"tertiary",children:n}):n}const{color:gS,cornerRadius:QO}=j,e5=R.keyframes`
72
+ color: hsl(${Math.max(0,Math.min(120-120*d,120))}deg 100% 31%);`,n?.key)}return o}}function de(e,t,n,r){return{debug:()=>{var o;return(o=e?.debugAll)!=null?o:e[t]},key:process.env.NODE_ENV==="development"&&n,onChange:r}}function b$(e,t,n,r){const o=()=>{var s;return(s=i.getValue())!=null?s:e.options.renderFallbackValue},i={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(r),renderValue:o,getContext:ue(()=>[e,n,t,i],(s,a,l,c)=>({table:s,column:a,row:l,cell:c,getValue:c.getValue,renderValue:c.renderValue}),de(e.options,"debugCells","cell.getContext"))};return e._features.forEach(s=>{s.createCell==null||s.createCell(i,n,t,e)},{}),i}function w$(e,t,n,r){var o,i;const a={...e._getDefaultColumnDef(),...t},l=a.accessorKey;let c=(o=(i=a.id)!=null?i:l?typeof String.prototype.replaceAll=="function"?l.replaceAll(".","_"):l.replace(/\./g,"_"):void 0)!=null?o:typeof a.header=="string"?a.header:void 0,u;if(a.accessorFn?u=a.accessorFn:l&&(l.includes(".")?u=d=>{let h=d;for(const p of l.split(".")){var g;h=(g=h)==null?void 0:g[p],process.env.NODE_ENV!=="production"&&h===void 0&&console.warn(`"${p}" in deeply nested key "${l}" returned undefined.`)}return h}:u=d=>d[a.accessorKey]),!c)throw process.env.NODE_ENV!=="production"?new Error(a.accessorFn?"Columns require an id when using an accessorFn":"Columns require an id when using a non-string header"):new Error;let f={id:`${String(c)}`,accessorFn:u,parent:r,depth:n,columnDef:a,columns:[],getFlatColumns:ue(()=>[!0],()=>{var d;return[f,...(d=f.columns)==null?void 0:d.flatMap(h=>h.getFlatColumns())]},de(e.options,"debugColumns","column.getFlatColumns")),getLeafColumns:ue(()=>[e._getOrderColumnsFn()],d=>{var h;if((h=f.columns)!=null&&h.length){let g=f.columns.flatMap(p=>p.getLeafColumns());return d(g)}return[f]},de(e.options,"debugColumns","column.getLeafColumns"))};for(const d of e._features)d.createColumn==null||d.createColumn(f,e);return f}const bt="debugHeaders";function v0(e,t,n){var r;let i={id:(r=n.id)!=null?r:t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const s=[],a=l=>{l.subHeaders&&l.subHeaders.length&&l.subHeaders.map(a),s.push(l)};return a(i),s},getContext:()=>({table:e,header:i,column:t})};return e._features.forEach(s=>{s.createHeader==null||s.createHeader(i,e)}),i}const C$={createTable:e=>{e.getHeaderGroups=ue(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,o)=>{var i,s;const a=(i=r?.map(f=>n.find(d=>d.id===f)).filter(Boolean))!=null?i:[],l=(s=o?.map(f=>n.find(d=>d.id===f)).filter(Boolean))!=null?s:[],c=n.filter(f=>!(r!=null&&r.includes(f.id))&&!(o!=null&&o.includes(f.id)));return Ua(t,[...a,...c,...l],e)},de(e.options,bt,"getHeaderGroups")),e.getCenterHeaderGroups=ue(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,o)=>(n=n.filter(i=>!(r!=null&&r.includes(i.id))&&!(o!=null&&o.includes(i.id))),Ua(t,n,e,"center")),de(e.options,bt,"getCenterHeaderGroups")),e.getLeftHeaderGroups=ue(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,r)=>{var o;const i=(o=r?.map(s=>n.find(a=>a.id===s)).filter(Boolean))!=null?o:[];return Ua(t,i,e,"left")},de(e.options,bt,"getLeftHeaderGroups")),e.getRightHeaderGroups=ue(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,r)=>{var o;const i=(o=r?.map(s=>n.find(a=>a.id===s)).filter(Boolean))!=null?o:[];return Ua(t,i,e,"right")},de(e.options,bt,"getRightHeaderGroups")),e.getFooterGroups=ue(()=>[e.getHeaderGroups()],t=>[...t].reverse(),de(e.options,bt,"getFooterGroups")),e.getLeftFooterGroups=ue(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),de(e.options,bt,"getLeftFooterGroups")),e.getCenterFooterGroups=ue(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),de(e.options,bt,"getCenterFooterGroups")),e.getRightFooterGroups=ue(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),de(e.options,bt,"getRightFooterGroups")),e.getFlatHeaders=ue(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),de(e.options,bt,"getFlatHeaders")),e.getLeftFlatHeaders=ue(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),de(e.options,bt,"getLeftFlatHeaders")),e.getCenterFlatHeaders=ue(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),de(e.options,bt,"getCenterFlatHeaders")),e.getRightFlatHeaders=ue(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),de(e.options,bt,"getRightFlatHeaders")),e.getCenterLeafHeaders=ue(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),de(e.options,bt,"getCenterLeafHeaders")),e.getLeftLeafHeaders=ue(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),de(e.options,bt,"getLeftLeafHeaders")),e.getRightLeafHeaders=ue(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),de(e.options,bt,"getRightLeafHeaders")),e.getLeafHeaders=ue(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,r)=>{var o,i,s,a,l,c;return[...(o=(i=t[0])==null?void 0:i.headers)!=null?o:[],...(s=(a=n[0])==null?void 0:a.headers)!=null?s:[],...(l=(c=r[0])==null?void 0:c.headers)!=null?l:[]].map(u=>u.getLeafHeaders()).flat()},de(e.options,bt,"getLeafHeaders"))}};function Ua(e,t,n,r){var o,i;let s=0;const a=function(d,h){h===void 0&&(h=1),s=Math.max(s,h),d.filter(g=>g.getIsVisible()).forEach(g=>{var p;(p=g.columns)!=null&&p.length&&a(g.columns,h+1)},0)};a(e);let l=[];const c=(d,h)=>{const g={depth:h,id:[r,`${h}`].filter(Boolean).join("_"),headers:[]},p=[];d.forEach(m=>{const v=[...p].reverse()[0],y=m.column.depth===g.depth;let x,b=!1;if(y&&m.column.parent?x=m.column.parent:(x=m.column,b=!0),v&&v?.column===x)v.subHeaders.push(m);else{const w=v0(n,x,{id:[r,h,x.id,m?.id].filter(Boolean).join("_"),isPlaceholder:b,placeholderId:b?`${p.filter(_=>_.column===x).length}`:void 0,depth:h,index:p.length});w.subHeaders.push(m),p.push(w)}g.headers.push(m),m.headerGroup=g}),l.push(g),h>0&&c(p,h-1)},u=t.map((d,h)=>v0(n,d,{depth:s,index:h}));c(u,s-1),l.reverse();const f=d=>d.filter(g=>g.column.getIsVisible()).map(g=>{let p=0,m=0,v=[0];g.subHeaders&&g.subHeaders.length?(v=[],f(g.subHeaders).forEach(x=>{let{colSpan:b,rowSpan:w}=x;p+=b,v.push(w)})):p=1;const y=Math.min(...v);return m=m+y,g.colSpan=p,g.rowSpan=m,{colSpan:p,rowSpan:m}});return f((o=(i=l[0])==null?void 0:i.headers)!=null?o:[]),l}const S$=(e,t,n,r,o,i,s)=>{let a={id:t,index:r,original:n,depth:o,parentId:s,_valuesCache:{},_uniqueValuesCache:{},getValue:l=>{if(a._valuesCache.hasOwnProperty(l))return a._valuesCache[l];const c=e.getColumn(l);if(c!=null&&c.accessorFn)return a._valuesCache[l]=c.accessorFn(a.original,r),a._valuesCache[l]},getUniqueValues:l=>{if(a._uniqueValuesCache.hasOwnProperty(l))return a._uniqueValuesCache[l];const c=e.getColumn(l);if(c!=null&&c.accessorFn)return c.columnDef.getUniqueValues?(a._uniqueValuesCache[l]=c.columnDef.getUniqueValues(a.original,r),a._uniqueValuesCache[l]):(a._uniqueValuesCache[l]=[a.getValue(l)],a._uniqueValuesCache[l])},renderValue:l=>{var c;return(c=a.getValue(l))!=null?c:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>x$(a.subRows,l=>l.subRows),getParentRow:()=>a.parentId?e.getRow(a.parentId,!0):void 0,getParentRows:()=>{let l=[],c=a;for(;;){const u=c.getParentRow();if(!u)break;l.push(u),c=u}return l.reverse()},getAllCells:ue(()=>[e.getAllLeafColumns()],l=>l.map(c=>b$(e,a,c,c.id)),de(e.options,"debugRows","getAllCells")),_getAllCellsByColumnId:ue(()=>[a.getAllCells()],l=>l.reduce((c,u)=>(c[u.column.id]=u,c),{}),de(e.options,"debugRows","getAllCellsByColumnId"))};for(let l=0;l<e._features.length;l++){const c=e._features[l];c==null||c.createRow==null||c.createRow(a,e)}return a},_$={createColumn:(e,t)=>{e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},eS=(e,t,n)=>{var r,o;const i=n==null||(r=n.toString())==null?void 0:r.toLowerCase();return!!(!((o=e.getValue(t))==null||(o=o.toString())==null||(o=o.toLowerCase())==null)&&o.includes(i))};eS.autoRemove=e=>Rn(e);const tS=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};tS.autoRemove=e=>Rn(e);const nS=(e,t,n)=>{var r;return((r=e.getValue(t))==null||(r=r.toString())==null?void 0:r.toLowerCase())===n?.toLowerCase()};nS.autoRemove=e=>Rn(e);const rS=(e,t,n)=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(n)};rS.autoRemove=e=>Rn(e);const oS=(e,t,n)=>!n.some(r=>{var o;return!((o=e.getValue(t))!=null&&o.includes(r))});oS.autoRemove=e=>Rn(e)||!(e!=null&&e.length);const iS=(e,t,n)=>n.some(r=>{var o;return(o=e.getValue(t))==null?void 0:o.includes(r)});iS.autoRemove=e=>Rn(e)||!(e!=null&&e.length);const sS=(e,t,n)=>e.getValue(t)===n;sS.autoRemove=e=>Rn(e);const aS=(e,t,n)=>e.getValue(t)==n;aS.autoRemove=e=>Rn(e);const Sg=(e,t,n)=>{let[r,o]=n;const i=e.getValue(t);return i>=r&&i<=o};Sg.resolveFilterValue=e=>{let[t,n]=e,r=typeof t!="number"?parseFloat(t):t,o=typeof n!="number"?parseFloat(n):n,i=t===null||Number.isNaN(r)?-1/0:r,s=n===null||Number.isNaN(o)?1/0:o;if(i>s){const a=i;i=s,s=a}return[i,s]};Sg.autoRemove=e=>Rn(e)||Rn(e[0])&&Rn(e[1]);const ar={includesString:eS,includesStringSensitive:tS,equalsString:nS,arrIncludes:rS,arrIncludesAll:oS,arrIncludesSome:iS,equals:sS,weakEquals:aS,inNumberRange:Sg};function Rn(e){return e==null||e===""}const T$={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:Jt("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n?.getValue(e.id);return typeof r=="string"?ar.includesString:typeof r=="number"?ar.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?ar.equals:Array.isArray(r)?ar.arrIncludes:ar.weakEquals},e.getFilterFn=()=>{var n,r;return _c(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(n=(r=t.options.filterFns)==null?void 0:r[e.columnDef.filterFn])!=null?n:ar[e.columnDef.filterFn]},e.getCanFilter=()=>{var n,r,o;return((n=e.columnDef.enableColumnFilter)!=null?n:!0)&&((r=t.options.enableColumnFilters)!=null?r:!0)&&((o=t.options.enableFilters)!=null?o:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var n;return(n=t.getState().columnFilters)==null||(n=n.find(r=>r.id===e.id))==null?void 0:n.value},e.getFilterIndex=()=>{var n,r;return(n=(r=t.getState().columnFilters)==null?void 0:r.findIndex(o=>o.id===e.id))!=null?n:-1},e.setFilterValue=n=>{t.setColumnFilters(r=>{const o=e.getFilterFn(),i=r?.find(u=>u.id===e.id),s=$r(n,i?i.value:void 0);if(x0(o,s,e)){var a;return(a=r?.filter(u=>u.id!==e.id))!=null?a:[]}const l={id:e.id,value:s};if(i){var c;return(c=r?.map(u=>u.id===e.id?l:u))!=null?c:[]}return r!=null&&r.length?[...r,l]:[l]})}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=t=>{const n=e.getAllLeafColumns(),r=o=>{var i;return(i=$r(t,o))==null?void 0:i.filter(s=>{const a=n.find(l=>l.id===s.id);if(a){const l=a.getFilterFn();if(x0(l,s.value,a))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(r)},e.resetColumnFilters=t=>{var n,r;e.setColumnFilters(t?[]:(n=(r=e.initialState)==null?void 0:r.columnFilters)!=null?n:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel())}};function x0(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const E$=(e,t,n)=>n.reduce((r,o)=>{const i=o.getValue(e);return r+(typeof i=="number"?i:0)},0),R$=(e,t,n)=>{let r;return n.forEach(o=>{const i=o.getValue(e);i!=null&&(r>i||r===void 0&&i>=i)&&(r=i)}),r},k$=(e,t,n)=>{let r;return n.forEach(o=>{const i=o.getValue(e);i!=null&&(r<i||r===void 0&&i>=i)&&(r=i)}),r},A$=(e,t,n)=>{let r,o;return n.forEach(i=>{const s=i.getValue(e);s!=null&&(r===void 0?s>=s&&(r=o=s):(r>s&&(r=s),o<s&&(o=s)))}),[r,o]},N$=(e,t)=>{let n=0,r=0;if(t.forEach(o=>{let i=o.getValue(e);i!=null&&(i=+i)>=i&&(++n,r+=i)}),n)return r/n},M$=(e,t)=>{if(!t.length)return;const n=t.map(i=>i.getValue(e));if(!v$(n))return;if(n.length===1)return n[0];const r=Math.floor(n.length/2),o=n.sort((i,s)=>i-s);return n.length%2!==0?o[r]:(o[r-1]+o[r])/2},P$=(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),L$=(e,t)=>new Set(t.map(n=>n.getValue(e))).size,F$=(e,t)=>t.length,Gu={sum:E$,min:R$,max:k$,extent:A$,mean:N$,median:M$,unique:P$,uniqueCount:L$,count:F$},$$={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,n;return(t=(n=e.getValue())==null||n.toString==null?void 0:n.toString())!=null?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:Jt("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping(n=>n!=null&&n.includes(e.id)?n.filter(r=>r!==e.id):[...n??[],e.id])},e.getCanGroup=()=>{var n,r;return((n=e.columnDef.enableGrouping)!=null?n:!0)&&((r=t.options.enableGrouping)!=null?r:!0)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.includes(e.id)},e.getGroupedIndex=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const n=e.getCanGroup();return()=>{n&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n?.getValue(e.id);if(typeof r=="number")return Gu.sum;if(Object.prototype.toString.call(r)==="[object Date]")return Gu.extent},e.getAggregationFn=()=>{var n,r;if(!e)throw new Error;return _c(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(n=(r=t.options.aggregationFns)==null?void 0:r[e.columnDef.aggregationFn])!=null?n:Gu[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var n,r;e.setGrouping(t?[]:(n=(r=e.initialState)==null?void 0:r.grouping)!=null?n:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=n=>{if(e._groupingValuesCache.hasOwnProperty(n))return e._groupingValuesCache[n];const r=t.getColumn(n);return r!=null&&r.columnDef.getGroupingValue?(e._groupingValuesCache[n]=r.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},e._groupingValuesCache={}},createCell:(e,t,n,r)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===n.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var o;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((o=n.subRows)!=null&&o.length)}}};function O$(e,t,n){if(!(t!=null&&t.length)||!n)return e;const r=e.filter(i=>!t.includes(i.id));return n==="remove"?r:[...t.map(i=>e.find(s=>s.id===i)).filter(Boolean),...r]}const I$={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:Jt("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=ue(n=>[Ls(t,n)],n=>n.findIndex(r=>r.id===e.id),de(t.options,"debugColumns","getIndex")),e.getIsFirstColumn=n=>{var r;return((r=Ls(t,n)[0])==null?void 0:r.id)===e.id},e.getIsLastColumn=n=>{var r;const o=Ls(t,n);return((r=o[o.length-1])==null?void 0:r.id)===e.id}},createTable:e=>{e.setColumnOrder=t=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{var n;e.setColumnOrder(t?[]:(n=e.initialState.columnOrder)!=null?n:[])},e._getOrderColumnsFn=ue(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(t,n,r)=>o=>{let i=[];if(!(t!=null&&t.length))i=o;else{const s=[...t],a=[...o];for(;a.length&&s.length;){const l=s.shift(),c=a.findIndex(u=>u.id===l);c>-1&&i.push(a.splice(c,1)[0])}i=[...i,...a]}return O$(i,n,r)},de(e.options,"debugTable","_getOrderColumnsFn"))}},qu=()=>({left:[],right:[]}),D$={getInitialState:e=>({columnPinning:qu(),...e}),getDefaultOptions:e=>({onColumnPinningChange:Jt("columnPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const r=e.getLeafColumns().map(o=>o.id).filter(Boolean);t.setColumnPinning(o=>{var i,s;if(n==="right"){var a,l;return{left:((a=o?.left)!=null?a:[]).filter(f=>!(r!=null&&r.includes(f))),right:[...((l=o?.right)!=null?l:[]).filter(f=>!(r!=null&&r.includes(f))),...r]}}if(n==="left"){var c,u;return{left:[...((c=o?.left)!=null?c:[]).filter(f=>!(r!=null&&r.includes(f))),...r],right:((u=o?.right)!=null?u:[]).filter(f=>!(r!=null&&r.includes(f)))}}return{left:((i=o?.left)!=null?i:[]).filter(f=>!(r!=null&&r.includes(f))),right:((s=o?.right)!=null?s:[]).filter(f=>!(r!=null&&r.includes(f)))}})},e.getCanPin=()=>e.getLeafColumns().some(r=>{var o,i,s;return((o=r.columnDef.enablePinning)!=null?o:!0)&&((i=(s=t.options.enableColumnPinning)!=null?s:t.options.enablePinning)!=null?i:!0)}),e.getIsPinned=()=>{const n=e.getLeafColumns().map(a=>a.id),{left:r,right:o}=t.getState().columnPinning,i=n.some(a=>r?.includes(a)),s=n.some(a=>o?.includes(a));return i?"left":s?"right":!1},e.getPinnedIndex=()=>{var n,r;const o=e.getIsPinned();return o?(n=(r=t.getState().columnPinning)==null||(r=r[o])==null?void 0:r.indexOf(e.id))!=null?n:-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=ue(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(n,r,o)=>{const i=[...r??[],...o??[]];return n.filter(s=>!i.includes(s.column.id))},de(t.options,"debugRows","getCenterVisibleCells")),e.getLeftVisibleCells=ue(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(n,r)=>(r??[]).map(i=>n.find(s=>s.column.id===i)).filter(Boolean).map(i=>({...i,position:"left"})),de(t.options,"debugRows","getLeftVisibleCells")),e.getRightVisibleCells=ue(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(n,r)=>(r??[]).map(i=>n.find(s=>s.column.id===i)).filter(Boolean).map(i=>({...i,position:"right"})),de(t.options,"debugRows","getRightVisibleCells"))},createTable:e=>{e.setColumnPinning=t=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var n,r;return e.setColumnPinning(t?qu():(n=(r=e.initialState)==null?void 0:r.columnPinning)!=null?n:qu())},e.getIsSomeColumnsPinned=t=>{var n;const r=e.getState().columnPinning;if(!t){var o,i;return!!((o=r.left)!=null&&o.length||(i=r.right)!=null&&i.length)}return!!((n=r[t])!=null&&n.length)},e.getLeftLeafColumns=ue(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(r=>t.find(o=>o.id===r)).filter(Boolean),de(e.options,"debugColumns","getLeftLeafColumns")),e.getRightLeafColumns=ue(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(r=>t.find(o=>o.id===r)).filter(Boolean),de(e.options,"debugColumns","getRightLeafColumns")),e.getCenterLeafColumns=ue(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r)=>{const o=[...n??[],...r??[]];return t.filter(i=>!o.includes(i.id))},de(e.options,"debugColumns","getCenterLeafColumns"))}};function j$(e){return e||(typeof document<"u"?document:null)}const Ga={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},Yu=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),V$={getDefaultColumnDef:()=>Ga,getInitialState:e=>({columnSizing:{},columnSizingInfo:Yu(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:Jt("columnSizing",e),onColumnSizingInfoChange:Jt("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,r,o;const i=t.getState().columnSizing[e.id];return Math.min(Math.max((n=e.columnDef.minSize)!=null?n:Ga.minSize,(r=i??e.columnDef.size)!=null?r:Ga.size),(o=e.columnDef.maxSize)!=null?o:Ga.maxSize)},e.getStart=ue(n=>[n,Ls(t,n),t.getState().columnSizing],(n,r)=>r.slice(0,e.getIndex(n)).reduce((o,i)=>o+i.getSize(),0),de(t.options,"debugColumns","getStart")),e.getAfter=ue(n=>[n,Ls(t,n),t.getState().columnSizing],(n,r)=>r.slice(e.getIndex(n)+1).reduce((o,i)=>o+i.getSize(),0),de(t.options,"debugColumns","getAfter")),e.resetSize=()=>{t.setColumnSizing(n=>{let{[e.id]:r,...o}=n;return o})},e.getCanResize=()=>{var n,r;return((n=e.columnDef.enableResizing)!=null?n:!0)&&((r=t.options.enableColumnResizing)!=null?r:!0)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let n=0;const r=o=>{if(o.subHeaders.length)o.subHeaders.forEach(r);else{var i;n+=(i=o.column.getSize())!=null?i:0}};return r(e),n},e.getStart=()=>{if(e.index>0){const n=e.headerGroup.headers[e.index-1];return n.getStart()+n.getSize()}return 0},e.getResizeHandler=n=>{const r=t.getColumn(e.column.id),o=r?.getCanResize();return i=>{if(!r||!o||(i.persist==null||i.persist(),Xu(i)&&i.touches&&i.touches.length>1))return;const s=e.getSize(),a=e?e.getLeafHeaders().map(v=>[v.column.id,v.column.getSize()]):[[r.id,r.getSize()]],l=Xu(i)?Math.round(i.touches[0].clientX):i.clientX,c={},u=(v,y)=>{typeof y=="number"&&(t.setColumnSizingInfo(x=>{var b,w;const _=t.options.columnResizeDirection==="rtl"?-1:1,E=(y-((b=x?.startOffset)!=null?b:0))*_,R=Math.max(E/((w=x?.startSize)!=null?w:0),-.999999);return x.columnSizingStart.forEach(k=>{let[M,F]=k;c[M]=Math.round(Math.max(F+F*R,0)*100)/100}),{...x,deltaOffset:E,deltaPercentage:R}}),(t.options.columnResizeMode==="onChange"||v==="end")&&t.setColumnSizing(x=>({...x,...c})))},f=v=>u("move",v),d=v=>{u("end",v),t.setColumnSizingInfo(y=>({...y,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},h=j$(n),g={moveHandler:v=>f(v.clientX),upHandler:v=>{h?.removeEventListener("mousemove",g.moveHandler),h?.removeEventListener("mouseup",g.upHandler),d(v.clientX)}},p={moveHandler:v=>(v.cancelable&&(v.preventDefault(),v.stopPropagation()),f(v.touches[0].clientX),!1),upHandler:v=>{var y;h?.removeEventListener("touchmove",p.moveHandler),h?.removeEventListener("touchend",p.upHandler),v.cancelable&&(v.preventDefault(),v.stopPropagation()),d((y=v.touches[0])==null?void 0:y.clientX)}},m=B$()?{passive:!1}:!1;Xu(i)?(h?.addEventListener("touchmove",p.moveHandler,m),h?.addEventListener("touchend",p.upHandler,m)):(h?.addEventListener("mousemove",g.moveHandler,m),h?.addEventListener("mouseup",g.upHandler,m)),t.setColumnSizingInfo(v=>({...v,startOffset:l,startSize:s,deltaOffset:0,deltaPercentage:0,columnSizingStart:a,isResizingColumn:r.id}))}}},createTable:e=>{e.setColumnSizing=t=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var n;e.setColumnSizing(t?{}:(n=e.initialState.columnSizing)!=null?n:{})},e.resetHeaderSizeInfo=t=>{var n;e.setColumnSizingInfo(t?Yu():(n=e.initialState.columnSizingInfo)!=null?n:Yu())},e.getTotalSize=()=>{var t,n;return(t=(n=e.getHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getLeftTotalSize=()=>{var t,n;return(t=(n=e.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getCenterTotalSize=()=>{var t,n;return(t=(n=e.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getRightTotalSize=()=>{var t,n;return(t=(n=e.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0}}};let qa=null;function B$(){if(typeof qa=="boolean")return qa;let e=!1;try{const t={get passive(){return e=!0,!1}},n=()=>{};window.addEventListener("test",n,t),window.removeEventListener("test",n)}catch{e=!1}return qa=e,qa}function Xu(e){return e.type==="touchstart"}const z$={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:Jt("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility(r=>({...r,[e.id]:n??!e.getIsVisible()}))},e.getIsVisible=()=>{var n,r;const o=e.columns;return(n=o.length?o.some(i=>i.getIsVisible()):(r=t.getState().columnVisibility)==null?void 0:r[e.id])!=null?n:!0},e.getCanHide=()=>{var n,r;return((n=e.columnDef.enableHiding)!=null?n:!0)&&((r=t.options.enableHiding)!=null?r:!0)},e.getToggleVisibilityHandler=()=>n=>{e.toggleVisibility==null||e.toggleVisibility(n.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=ue(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(r=>r.column.getIsVisible()),de(t.options,"debugRows","_getAllVisibleCells")),e.getVisibleCells=ue(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,r,o)=>[...n,...r,...o],de(t.options,"debugRows","getVisibleCells"))},createTable:e=>{const t=(n,r)=>ue(()=>[r(),r().filter(o=>o.getIsVisible()).map(o=>o.id).join("_")],o=>o.filter(i=>i.getIsVisible==null?void 0:i.getIsVisible()),de(e.options,"debugColumns",n));e.getVisibleFlatColumns=t("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=t("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=t("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=t("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=t("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=n=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(n),e.resetColumnVisibility=n=>{var r;e.setColumnVisibility(n?{}:(r=e.initialState.columnVisibility)!=null?r:{})},e.toggleAllColumnsVisible=n=>{var r;n=(r=n)!=null?r:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((o,i)=>({...o,[i.id]:n||!(i.getCanHide!=null&&i.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(n=>!(n.getIsVisible!=null&&n.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(n=>n.getIsVisible==null?void 0:n.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>n=>{var r;e.toggleAllColumnsVisible((r=n.target)==null?void 0:r.checked)}}};function Ls(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const H$={createTable:e=>{e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}},W$={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:Jt("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n;const r=(n=e.getCoreRowModel().flatRows[0])==null||(n=n._getAllCellsByColumnId()[t.id])==null?void 0:n.getValue();return typeof r=="string"||typeof r=="number"}}),createColumn:(e,t)=>{e.getCanGlobalFilter=()=>{var n,r,o,i;return((n=e.columnDef.enableGlobalFilter)!=null?n:!0)&&((r=t.options.enableGlobalFilter)!=null?r:!0)&&((o=t.options.enableFilters)!=null?o:!0)&&((i=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?i:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>ar.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:r}=e.options;return _c(r)?r:r==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[r])!=null?t:ar[r]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},K$={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:Jt("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var r,o;if(!t){e._queue(()=>{t=!0});return}if((r=(o=e.options.autoResetAll)!=null?o:e.options.autoResetExpanded)!=null?r:!e.options.manualExpanding){if(n)return;n=!0,e._queue(()=>{e.resetExpanded(),n=!1})}},e.setExpanded=r=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(r),e.toggleAllRowsExpanded=r=>{r??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=r=>{var o,i;e.setExpanded(r?{}:(o=(i=e.initialState)==null?void 0:i.expanded)!=null?o:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(r=>r.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>r=>{r.persist==null||r.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const r=e.getState().expanded;return r===!0||Object.values(r).some(Boolean)},e.getIsAllRowsExpanded=()=>{const r=e.getState().expanded;return typeof r=="boolean"?r===!0:!(!Object.keys(r).length||e.getRowModel().flatRows.some(o=>!o.getIsExpanded()))},e.getExpandedDepth=()=>{let r=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(i=>{const s=i.split(".");r=Math.max(r,s.length)}),r},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,t)=>{e.toggleExpanded=n=>{t.setExpanded(r=>{var o;const i=r===!0?!0:!!(r!=null&&r[e.id]);let s={};if(r===!0?Object.keys(t.getRowModel().rowsById).forEach(a=>{s[a]=!0}):s=r,n=(o=n)!=null?o:!i,!i&&n)return{...s,[e.id]:!0};if(i&&!n){const{[e.id]:a,...l}=s;return l}return r})},e.getIsExpanded=()=>{var n;const r=t.getState().expanded;return!!((n=t.options.getIsRowExpanded==null?void 0:t.options.getIsRowExpanded(e))!=null?n:r===!0||r?.[e.id])},e.getCanExpand=()=>{var n,r,o;return(n=t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))!=null?n:((r=t.options.enableExpanding)!=null?r:!0)&&!!((o=e.subRows)!=null&&o.length)},e.getIsAllParentsExpanded=()=>{let n=!0,r=e;for(;n&&r.parentId;)r=t.getRow(r.parentId,!0),n=r.getIsExpanded();return n},e.getToggleExpandedHandler=()=>{const n=e.getCanExpand();return()=>{n&&e.toggleExpanded()}}}},_f=0,Tf=10,Zu=()=>({pageIndex:_f,pageSize:Tf}),U$={getInitialState:e=>({...e,pagination:{...Zu(),...e?.pagination}}),getDefaultOptions:e=>({onPaginationChange:Jt("pagination",e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{var r,o;if(!t){e._queue(()=>{t=!0});return}if((r=(o=e.options.autoResetAll)!=null?o:e.options.autoResetPageIndex)!=null?r:!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},e.setPagination=r=>{const o=i=>$r(r,i);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(o)},e.resetPagination=r=>{var o;e.setPagination(r?Zu():(o=e.initialState.pagination)!=null?o:Zu())},e.setPageIndex=r=>{e.setPagination(o=>{let i=$r(r,o.pageIndex);const s=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return i=Math.max(0,Math.min(i,s)),{...o,pageIndex:i}})},e.resetPageIndex=r=>{var o,i;e.setPageIndex(r?_f:(o=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageIndex)!=null?o:_f)},e.resetPageSize=r=>{var o,i;e.setPageSize(r?Tf:(o=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageSize)!=null?o:Tf)},e.setPageSize=r=>{e.setPagination(o=>{const i=Math.max(1,$r(r,o.pageSize)),s=o.pageSize*o.pageIndex,a=Math.floor(s/i);return{...o,pageIndex:a,pageSize:i}})},e.setPageCount=r=>e.setPagination(o=>{var i;let s=$r(r,(i=e.options.pageCount)!=null?i:-1);return typeof s=="number"&&(s=Math.max(-1,s)),{...o,pageCount:s}}),e.getPageOptions=ue(()=>[e.getPageCount()],r=>{let o=[];return r&&r>0&&(o=[...new Array(r)].fill(null).map((i,s)=>s)),o},de(e.options,"debugTable","getPageOptions")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:r}=e.getState().pagination,o=e.getPageCount();return o===-1?!0:o===0?!1:r<o-1},e.previousPage=()=>e.setPageIndex(r=>r-1),e.nextPage=()=>e.setPageIndex(r=>r+1),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var r;return(r=e.options.pageCount)!=null?r:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var r;return(r=e.options.rowCount)!=null?r:e.getPrePaginationRowModel().rows.length}}},Ju=()=>({top:[],bottom:[]}),G$={getInitialState:e=>({rowPinning:Ju(),...e}),getDefaultOptions:e=>({onRowPinningChange:Jt("rowPinning",e)}),createRow:(e,t)=>{e.pin=(n,r,o)=>{const i=r?e.getLeafRows().map(l=>{let{id:c}=l;return c}):[],s=o?e.getParentRows().map(l=>{let{id:c}=l;return c}):[],a=new Set([...s,e.id,...i]);t.setRowPinning(l=>{var c,u;if(n==="bottom"){var f,d;return{top:((f=l?.top)!=null?f:[]).filter(p=>!(a!=null&&a.has(p))),bottom:[...((d=l?.bottom)!=null?d:[]).filter(p=>!(a!=null&&a.has(p))),...Array.from(a)]}}if(n==="top"){var h,g;return{top:[...((h=l?.top)!=null?h:[]).filter(p=>!(a!=null&&a.has(p))),...Array.from(a)],bottom:((g=l?.bottom)!=null?g:[]).filter(p=>!(a!=null&&a.has(p)))}}return{top:((c=l?.top)!=null?c:[]).filter(p=>!(a!=null&&a.has(p))),bottom:((u=l?.bottom)!=null?u:[]).filter(p=>!(a!=null&&a.has(p)))}})},e.getCanPin=()=>{var n;const{enableRowPinning:r,enablePinning:o}=t.options;return typeof r=="function"?r(e):(n=r??o)!=null?n:!0},e.getIsPinned=()=>{const n=[e.id],{top:r,bottom:o}=t.getState().rowPinning,i=n.some(a=>r?.includes(a)),s=n.some(a=>o?.includes(a));return i?"top":s?"bottom":!1},e.getPinnedIndex=()=>{var n,r;const o=e.getIsPinned();if(!o)return-1;const i=(n=o==="top"?t.getTopRows():t.getBottomRows())==null?void 0:n.map(s=>{let{id:a}=s;return a});return(r=i?.indexOf(e.id))!=null?r:-1}},createTable:e=>{e.setRowPinning=t=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var n,r;return e.setRowPinning(t?Ju():(n=(r=e.initialState)==null?void 0:r.rowPinning)!=null?n:Ju())},e.getIsSomeRowsPinned=t=>{var n;const r=e.getState().rowPinning;if(!t){var o,i;return!!((o=r.top)!=null&&o.length||(i=r.bottom)!=null&&i.length)}return!!((n=r[t])!=null&&n.length)},e._getPinnedRows=(t,n,r)=>{var o;return((o=e.options.keepPinnedRows)==null||o?(n??[]).map(s=>{const a=e.getRow(s,!0);return a.getIsAllParentsExpanded()?a:null}):(n??[]).map(s=>t.find(a=>a.id===s))).filter(Boolean).map(s=>({...s,position:r}))},e.getTopRows=ue(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,"top"),de(e.options,"debugRows","getTopRows")),e.getBottomRows=ue(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,"bottom"),de(e.options,"debugRows","getBottomRows")),e.getCenterRows=ue(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(t,n,r)=>{const o=new Set([...n??[],...r??[]]);return t.filter(i=>!o.has(i.id))},de(e.options,"debugRows","getCenterRows"))}},q$={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:Jt("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>{var n;return e.setRowSelection(t?{}:(n=e.initialState.rowSelection)!=null?n:{})},e.toggleAllRowsSelected=t=>{e.setRowSelection(n=>{t=typeof t<"u"?t:!e.getIsAllRowsSelected();const r={...n},o=e.getPreGroupedRowModel().flatRows;return t?o.forEach(i=>{i.getCanSelect()&&(r[i.id]=!0)}):o.forEach(i=>{delete r[i.id]}),r})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{const r=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),o={...n};return e.getRowModel().rows.forEach(i=>{Ef(o,i.id,r,!0,e)}),o}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=ue(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?Qu(e,n):{rows:[],flatRows:[],rowsById:{}},de(e.options,"debugTable","getSelectedRowModel")),e.getFilteredSelectedRowModel=ue(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?Qu(e,n):{rows:[],flatRows:[],rowsById:{}},de(e.options,"debugTable","getFilteredSelectedRowModel")),e.getGroupedSelectedRowModel=ue(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?Qu(e,n):{rows:[],flatRows:[],rowsById:{}},de(e.options,"debugTable","getGroupedSelectedRowModel")),e.getIsAllRowsSelected=()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState();let r=!!(t.length&&Object.keys(n).length);return r&&t.some(o=>o.getCanSelect()&&!n[o.id])&&(r=!1),r},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter(o=>o.getCanSelect()),{rowSelection:n}=e.getState();let r=!!t.length;return r&&t.some(o=>!n[o.id])&&(r=!1),r},e.getIsSomeRowsSelected=()=>{var t;const n=Object.keys((t=e.getState().rowSelection)!=null?t:{}).length;return n>0&&n<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:t.filter(n=>n.getCanSelect()).some(n=>n.getIsSelected()||n.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(n,r)=>{const o=e.getIsSelected();t.setRowSelection(i=>{var s;if(n=typeof n<"u"?n:!o,e.getCanSelect()&&o===n)return i;const a={...i};return Ef(a,e.id,n,(s=r?.selectChildren)!=null?s:!0,t),a})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return _g(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return Rf(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return Rf(e,n)==="all"},e.getCanSelect=()=>{var n;return typeof t.options.enableRowSelection=="function"?t.options.enableRowSelection(e):(n=t.options.enableRowSelection)!=null?n:!0},e.getCanSelectSubRows=()=>{var n;return typeof t.options.enableSubRowSelection=="function"?t.options.enableSubRowSelection(e):(n=t.options.enableSubRowSelection)!=null?n:!0},e.getCanMultiSelect=()=>{var n;return typeof t.options.enableMultiRowSelection=="function"?t.options.enableMultiRowSelection(e):(n=t.options.enableMultiRowSelection)!=null?n:!0},e.getToggleSelectedHandler=()=>{const n=e.getCanSelect();return r=>{var o;n&&e.toggleSelected((o=r.target)==null?void 0:o.checked)}}}},Ef=(e,t,n,r,o)=>{var i;const s=o.getRow(t,!0);n?(s.getCanMultiSelect()||Object.keys(e).forEach(a=>delete e[a]),s.getCanSelect()&&(e[t]=!0)):delete e[t],r&&(i=s.subRows)!=null&&i.length&&s.getCanSelectSubRows()&&s.subRows.forEach(a=>Ef(e,a.id,n,r,o))};function Qu(e,t){const n=e.getState().rowSelection,r=[],o={},i=function(s,a){return s.map(l=>{var c;const u=_g(l,n);if(u&&(r.push(l),o[l.id]=l),(c=l.subRows)!=null&&c.length&&(l={...l,subRows:i(l.subRows)}),u)return l}).filter(Boolean)};return{rows:i(t.rows),flatRows:r,rowsById:o}}function _g(e,t){var n;return(n=t[e.id])!=null?n:!1}function Rf(e,t,n){var r;if(!((r=e.subRows)!=null&&r.length))return!1;let o=!0,i=!1;return e.subRows.forEach(s=>{if(!(i&&!o)&&(s.getCanSelect()&&(_g(s,t)?i=!0:o=!1),s.subRows&&s.subRows.length)){const a=Rf(s,t);a==="all"?i=!0:(a==="some"&&(i=!0),o=!1)}}),o?"all":i?"some":!1}const kf=/([0-9]+)/gm,Y$=(e,t,n)=>lS(Xr(e.getValue(n)).toLowerCase(),Xr(t.getValue(n)).toLowerCase()),X$=(e,t,n)=>lS(Xr(e.getValue(n)),Xr(t.getValue(n))),Z$=(e,t,n)=>Tg(Xr(e.getValue(n)).toLowerCase(),Xr(t.getValue(n)).toLowerCase()),J$=(e,t,n)=>Tg(Xr(e.getValue(n)),Xr(t.getValue(n))),Q$=(e,t,n)=>{const r=e.getValue(n),o=t.getValue(n);return r>o?1:r<o?-1:0},eO=(e,t,n)=>Tg(e.getValue(n),t.getValue(n));function Tg(e,t){return e===t?0:e>t?1:-1}function Xr(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function lS(e,t){const n=e.split(kf).filter(Boolean),r=t.split(kf).filter(Boolean);for(;n.length&&r.length;){const o=n.shift(),i=r.shift(),s=parseInt(o,10),a=parseInt(i,10),l=[s,a].sort();if(isNaN(l[0])){if(o>i)return 1;if(i>o)return-1;continue}if(isNaN(l[1]))return isNaN(s)?-1:1;if(s>a)return 1;if(a>s)return-1}return n.length-r.length}const ms={alphanumeric:Y$,alphanumericCaseSensitive:X$,text:Z$,textCaseSensitive:J$,datetime:Q$,basic:eO},tO={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:Jt("sorting",e),isMultiSortEvent:t=>t.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let r=!1;for(const o of n){const i=o?.getValue(e.id);if(Object.prototype.toString.call(i)==="[object Date]")return ms.datetime;if(typeof i=="string"&&(r=!0,i.split(kf).length>1))return ms.alphanumeric}return r?ms.text:ms.basic},e.getAutoSortDir=()=>{const n=t.getFilteredRowModel().flatRows[0];return typeof n?.getValue(e.id)=="string"?"asc":"desc"},e.getSortingFn=()=>{var n,r;if(!e)throw new Error;return _c(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(n=(r=t.options.sortingFns)==null?void 0:r[e.columnDef.sortingFn])!=null?n:ms[e.columnDef.sortingFn]},e.toggleSorting=(n,r)=>{const o=e.getNextSortingOrder(),i=typeof n<"u"&&n!==null;t.setSorting(s=>{const a=s?.find(h=>h.id===e.id),l=s?.findIndex(h=>h.id===e.id);let c=[],u,f=i?n:o==="desc";if(s!=null&&s.length&&e.getCanMultiSort()&&r?a?u="toggle":u="add":s!=null&&s.length&&l!==s.length-1?u="replace":a?u="toggle":u="replace",u==="toggle"&&(i||o||(u="remove")),u==="add"){var d;c=[...s,{id:e.id,desc:f}],c.splice(0,c.length-((d=t.options.maxMultiSortColCount)!=null?d:Number.MAX_SAFE_INTEGER))}else u==="toggle"?c=s.map(h=>h.id===e.id?{...h,desc:f}:h):u==="remove"?c=s.filter(h=>h.id!==e.id):c=[{id:e.id,desc:f}];return c})},e.getFirstSortDir=()=>{var n,r;return((n=(r=e.columnDef.sortDescFirst)!=null?r:t.options.sortDescFirst)!=null?n:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=n=>{var r,o;const i=e.getFirstSortDir(),s=e.getIsSorted();return s?s!==i&&((r=t.options.enableSortingRemoval)==null||r)&&(!(n&&(o=t.options.enableMultiRemove)!=null)||o)?!1:s==="desc"?"asc":"desc":i},e.getCanSort=()=>{var n,r;return((n=e.columnDef.enableSorting)!=null?n:!0)&&((r=t.options.enableSorting)!=null?r:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var n,r;return(n=(r=e.columnDef.enableMultiSort)!=null?r:t.options.enableMultiSort)!=null?n:!!e.accessorFn},e.getIsSorted=()=>{var n;const r=(n=t.getState().sorting)==null?void 0:n.find(o=>o.id===e.id);return r?r.desc?"desc":"asc":!1},e.getSortIndex=()=>{var n,r;return(n=(r=t.getState().sorting)==null?void 0:r.findIndex(o=>o.id===e.id))!=null?n:-1},e.clearSorting=()=>{t.setSorting(n=>n!=null&&n.length?n.filter(r=>r.id!==e.id):[])},e.getToggleSortingHandler=()=>{const n=e.getCanSort();return r=>{n&&(r.persist==null||r.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?t.options.isMultiSortEvent==null?void 0:t.options.isMultiSortEvent(r):!1))}}},createTable:e=>{e.setSorting=t=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var n,r;e.setSorting(t?[]:(n=(r=e.initialState)==null?void 0:r.sorting)!=null?n:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},nO=[C$,z$,I$,D$,_$,T$,H$,W$,tO,$$,K$,U$,G$,q$,V$];function rO(e){var t,n;process.env.NODE_ENV!=="production"&&(e.debugAll||e.debugTable)&&console.info("Creating Table Instance...");const r=[...nO,...(t=e._features)!=null?t:[]];let o={_features:r};const i=o._features.reduce((d,h)=>Object.assign(d,h.getDefaultOptions==null?void 0:h.getDefaultOptions(o)),{}),s=d=>o.options.mergeOptions?o.options.mergeOptions(i,d):{...i,...d};let l={...{},...(n=e.initialState)!=null?n:{}};o._features.forEach(d=>{var h;l=(h=d.getInitialState==null?void 0:d.getInitialState(l))!=null?h:l});const c=[];let u=!1;const f={_features:r,options:{...i,...e},initialState:l,_queue:d=>{c.push(d),u||(u=!0,Promise.resolve().then(()=>{for(;c.length;)c.shift()();u=!1}).catch(h=>setTimeout(()=>{throw h})))},reset:()=>{o.setState(o.initialState)},setOptions:d=>{const h=$r(d,o.options);o.options=s(h)},getState:()=>o.options.state,setState:d=>{o.options.onStateChange==null||o.options.onStateChange(d)},_getRowId:(d,h,g)=>{var p;return(p=o.options.getRowId==null?void 0:o.options.getRowId(d,h,g))!=null?p:`${g?[g.id,h].join("."):h}`},getCoreRowModel:()=>(o._getCoreRowModel||(o._getCoreRowModel=o.options.getCoreRowModel(o)),o._getCoreRowModel()),getRowModel:()=>o.getPaginationRowModel(),getRow:(d,h)=>{let g=(h?o.getPrePaginationRowModel():o.getRowModel()).rowsById[d];if(!g&&(g=o.getCoreRowModel().rowsById[d],!g))throw process.env.NODE_ENV!=="production"?new Error(`getRow could not find row with ID: ${d}`):new Error;return g},_getDefaultColumnDef:ue(()=>[o.options.defaultColumn],d=>{var h;return d=(h=d)!=null?h:{},{header:g=>{const p=g.header.column.columnDef;return p.accessorKey?p.accessorKey:p.accessorFn?p.id:null},cell:g=>{var p,m;return(p=(m=g.renderValue())==null||m.toString==null?void 0:m.toString())!=null?p:null},...o._features.reduce((g,p)=>Object.assign(g,p.getDefaultColumnDef==null?void 0:p.getDefaultColumnDef()),{}),...d}},de(e,"debugColumns","_getDefaultColumnDef")),_getColumnDefs:()=>o.options.columns,getAllColumns:ue(()=>[o._getColumnDefs()],d=>{const h=function(g,p,m){return m===void 0&&(m=0),g.map(v=>{const y=w$(o,v,m,p),x=v;return y.columns=x.columns?h(x.columns,y,m+1):[],y})};return h(d)},de(e,"debugColumns","getAllColumns")),getAllFlatColumns:ue(()=>[o.getAllColumns()],d=>d.flatMap(h=>h.getFlatColumns()),de(e,"debugColumns","getAllFlatColumns")),_getAllFlatColumnsById:ue(()=>[o.getAllFlatColumns()],d=>d.reduce((h,g)=>(h[g.id]=g,h),{}),de(e,"debugColumns","getAllFlatColumnsById")),getAllLeafColumns:ue(()=>[o.getAllColumns(),o._getOrderColumnsFn()],(d,h)=>{let g=d.flatMap(p=>p.getLeafColumns());return h(g)},de(e,"debugColumns","getAllLeafColumns")),getColumn:d=>{const h=o._getAllFlatColumnsById()[d];return process.env.NODE_ENV!=="production"&&!h&&console.error(`[Table] Column with id '${d}' does not exist.`),h}};Object.assign(o,f);for(let d=0;d<o._features.length;d++){const h=o._features[d];h==null||h.createTable==null||h.createTable(o)}return o}function oO(){return e=>ue(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(o,i,s){i===void 0&&(i=0);const a=[];for(let c=0;c<o.length;c++){const u=S$(e,e._getRowId(o[c],c,s),o[c],c,i,void 0,s?.id);if(n.flatRows.push(u),n.rowsById[u.id]=u,a.push(u),e.options.getSubRows){var l;u.originalSubRows=e.options.getSubRows(o[c],c),(l=u.originalSubRows)!=null&&l.length&&(u.subRows=r(u.originalSubRows,i+1,u))}}return a};return n.rows=r(t),n},de(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex()))}function iO(e){const t=[],n=r=>{var o;t.push(r),(o=r.subRows)!=null&&o.length&&r.getIsExpanded()&&r.subRows.forEach(n)};return e.rows.forEach(n),{rows:t,flatRows:e.flatRows,rowsById:e.rowsById}}function sO(e){return t=>ue(()=>[t.getState().pagination,t.getPrePaginationRowModel(),t.options.paginateExpandedRows?void 0:t.getState().expanded],(n,r)=>{if(!r.rows.length)return r;const{pageSize:o,pageIndex:i}=n;let{rows:s,flatRows:a,rowsById:l}=r;const c=o*i,u=c+o;s=s.slice(c,u);let f;t.options.paginateExpandedRows?f={rows:s,flatRows:a,rowsById:l}:f=iO({rows:s,flatRows:a,rowsById:l}),f.flatRows=[];const d=h=>{f.flatRows.push(h),h.subRows.length&&h.subRows.forEach(d)};return f.rows.forEach(d),f},de(t.options,"debugTable","getPaginationRowModel"))}function aO(){return e=>ue(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,n)=>{if(!n.rows.length||!(t!=null&&t.length))return n;const r=e.getState().sorting,o=[],i=r.filter(l=>{var c;return(c=e.getColumn(l.id))==null?void 0:c.getCanSort()}),s={};i.forEach(l=>{const c=e.getColumn(l.id);c&&(s[l.id]={sortUndefined:c.columnDef.sortUndefined,invertSorting:c.columnDef.invertSorting,sortingFn:c.getSortingFn()})});const a=l=>{const c=l.map(u=>({...u}));return c.sort((u,f)=>{for(let h=0;h<i.length;h+=1){var d;const g=i[h],p=s[g.id],m=p.sortUndefined,v=(d=g?.desc)!=null?d:!1;let y=0;if(m){const x=u.getValue(g.id),b=f.getValue(g.id),w=x===void 0,_=b===void 0;if(w||_){if(m==="first")return w?-1:1;if(m==="last")return w?1:-1;y=w&&_?0:w?m:-m}}if(y===0&&(y=p.sortingFn(u,f,g.id)),y!==0)return v&&(y*=-1),p.invertSorting&&(y*=-1),y}return u.index-f.index}),c.forEach(u=>{var f;o.push(u),(f=u.subRows)!=null&&f.length&&(u.subRows=a(u.subRows))}),c};return{rows:a(n.rows),flatRows:o,rowsById:n.rowsById}},de(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex()))}function b0(e,t){return e?lO(e)?N.createElement(e,t):e:null}function lO(e){return cO(e)||typeof e=="function"||uO(e)}function cO(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function uO(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function dO(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=N.useState(()=>({current:rO(t)})),[r,o]=N.useState(()=>n.current.initialState);return n.current.setOptions(i=>({...i,...e,state:{...r,...e.state},onStateChange:s=>{o(s),e.onStateChange==null||e.onStateChange(s)}})),n.current}const fO=e=>N.createElement("svg",{width:32,height:32,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("style",null,`
73
+ @keyframes spin {
74
+ from {
75
+ transform: rotate(0deg);
76
+ }
77
+ to {
78
+ transform: rotate(360deg);
79
+ }
80
+ }
81
+ .spinner {
82
+ transform-origin: center;
83
+ animation: spin 1s linear infinite;
84
+ }
85
+ `),N.createElement("g",{className:"spinner"},N.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M16.0003 6.83317C13.5692 6.83317 11.2376 7.79894 9.51851 9.51803C7.79943 11.2371 6.83366 13.5687 6.83366 15.9998C6.83366 18.431 7.79943 20.7626 9.51851 22.4817C11.2376 24.2007 13.5692 25.1665 16.0003 25.1665C18.4315 25.1665 20.7631 24.2007 22.4821 22.4817C24.2012 20.7626 25.167 18.431 25.167 15.9998C25.167 13.5687 24.2012 11.2371 22.4821 9.51803C20.7631 7.79894 18.4315 6.83317 16.0003 6.83317ZM3.16699 15.9998C3.16699 8.91217 8.91266 3.1665 16.0003 3.1665C23.088 3.1665 28.8337 8.91217 28.8337 15.9998C28.8337 23.0875 23.088 28.8332 16.0003 28.8332C8.91266 28.8332 3.16699 23.0875 3.16699 15.9998Z",fill:"currentColor",fillOpacity:.12}),N.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.9997 6.83319C13.6363 6.82787 11.3633 7.74068 9.65999 9.37907C9.30711 9.70535 8.84021 9.88001 8.35982 9.86545C7.87943 9.85089 7.42396 9.64827 7.09149 9.30122C6.75902 8.95416 6.57612 8.49043 6.58218 8.00985C6.58823 7.52928 6.78276 7.07031 7.12388 6.73174C9.50956 4.43941 12.6912 3.16143 15.9997 3.16652C16.4859 3.16652 16.9522 3.35967 17.296 3.70349C17.6398 4.04731 17.833 4.51362 17.833 4.99985C17.833 5.48608 17.6398 5.9524 17.296 6.29621C16.9522 6.64003 16.4859 6.83319 15.9997 6.83319Z",fill:"currentColor"}))),hO=e=>N.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("g",{clipPath:"url(#clip0_2074_3858)"},N.createElement("path",{d:"M21 21L16.65 16.65M19 11C19 15.4183 15.4183 19 11 19C6.58172 19 3 15.4183 3 11C3 6.58172 6.58172 3 11 3C15.4183 3 19 6.58172 19 11Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),N.createElement("defs",null,N.createElement("clipPath",{id:"clip0_2074_3858"},N.createElement("rect",{width:24,height:24,fill:"white"})))),gO={table:T.css({...ye.body2,fontWeight:500})},cS=S.forwardRef(({children:e,className:t,style:n,...r},o)=>C.jsx("td",{ref:o,className:T.cx(t),style:n,...r,children:e}));cS.displayName="TableBodyCell";const{spacing:w0}=V,uS=S.forwardRef(({children:e,row:t=!0,justifyContent:n="flex-start",alignItems:r="center",py:o=w0.sm,px:i=w0.md,minHeight:s="56px",...a},l)=>C.jsx(q,{row:t,justifyContent:n,alignItems:r,py:o,px:i,minHeight:s,ref:l,...a,children:e}));uS.displayName="TableBodyCellContent";const{color:pO}=V,dS=S.forwardRef(({children:e,className:t,showBorders:n=!1,isSelected:r=!1,...o},i)=>{const s=T.css({borderBottom:n?`1px solid ${pO.border.neutralAlphaLow}`:"none"});return C.jsx("tr",{ref:i,className:T.cx(s,t),...o,children:e})});dS.displayName="TableBodyRow";const mO=S.forwardRef(({children:e,className:t,style:n,justifyContent:r="flex-start",alignItems:o="flex-start",...i},s)=>{const a=T.css({justifyContent:r,alignItems:o,fontWeight:"inherit"});return C.jsx("th",{ref:s,className:T.cx(a,t),style:n,...i,children:e})}),{spacing:C0}=V,Eg=S.forwardRef(({children:e,row:t=!0,justifyContent:n="flex-start",alignItems:r="center",py:o=C0.sm,px:i=C0.md,minHeight:s="56px",className:a,center:l,...c},u)=>C.jsx(q,{ref:u,row:t,justifyContent:n,alignItems:r,py:o,px:i,minHeight:s,center:l,className:T.cx(a,T.css({textAlign:l?"center":"left"})),...c,children:e}));Eg.displayName="TableHeadCellContent";const yO=e=>N.createElement("svg",{width:10,height:6,viewBox:"0 0 10 6",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M8.75 0.75L4.75 4.75L0.75 0.75",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),vO=e=>N.createElement("svg",{width:10,height:6,viewBox:"0 0 10 6",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M8.75 4.75L4.75 0.75L0.75 4.75",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),{color:Ya}=V,xO=({sortDirection:e,gap:t="5px",...n})=>C.jsxs(q,{gap:t,...n,children:[C.jsx(vO,{style:{color:e==="asc"?Ya.icon.accent:Ya.icon.tertiary}}),C.jsx(yO,{style:{color:e==="desc"?Ya.icon.accent:Ya.icon.tertiary}})]}),fS=({children:e,tableProps:t,gap:n="10px",...r})=>{const o=t.column.getIsSorted();return C.jsxs(Eg,{style:{cursor:"pointer",userSelect:"none"},gap:n,...r,children:[e,C.jsx(xO,{sortDirection:o})]})};fS.displayName="TableHeadCellContentSortable";const{color:S0}=V,hS=S.forwardRef(({children:e,className:t,showBorders:n=!1,...r},o)=>{const i=T.css({backgroundColor:S0.fill.bgSecondary,borderBottom:n?`1px solid ${S0.border.neutralAlphaLow}`:"none"});return C.jsx("tr",{ref:o,className:T.cx(i,t),...r,children:e})});hS.displayName="TableHeadRow";const _0=e=>N.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M15 18L9 12L15 6",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),T0=e=>N.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M9 18L15 12L9 6",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),bO=e=>N.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M12 13C12.5523 13 13 12.5523 13 12C13 11.4477 12.5523 11 12 11C11.4477 11 11 11.4477 11 12C11 12.5523 11.4477 13 12 13Z",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),N.createElement("path",{d:"M19 13C19.5523 13 20 12.5523 20 12C20 11.4477 19.5523 11 19 11C18.4477 11 18 11.4477 18 12C18 12.5523 18.4477 13 19 13Z",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),N.createElement("path",{d:"M5 13C5.55228 13 6 12.5523 6 12C6 11.4477 5.55228 11 5 11C4.44772 11 4 11.4477 4 12C4 12.5523 4.44772 13 5 13Z",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),ed=(e,t)=>{const n=t-e+1;return Array.from({length:n},(r,o)=>e+o)};function wO(e){const{count:t=1,page:n,maxVisiblePages:r=10}=e;let o=1,i=1;if(r<=2)return[n];r<=4?(o=0,i=0):r<=6?(o=1,i=0):r<=7?(o=1,i=Math.max(0,Math.floor((r-4)/2))):(o=1,i=Math.max(1,Math.floor((r-5)/2)));const s=ed(1,Math.min(o,t)),a=ed(Math.max(t-o+1,o+1),t),l=Math.max(Math.min(n-i,t-o-i*2-1),o+2),c=Math.min(Math.max(n+i,o+i*2+2),t-o-1);return[...s,...l>o+2?["start-dots"]:o+1<t-o?[o+1]:[],...ed(l,c),...c<t-o-1?["end-dots"]:t-o>o?[t-o]:[],...a]}const{color:si,cornerRadius:CO,spacing:td}=V,SO=({pageIndex:e,pageSize:t,totalCount:n,onPageChange:r,onPageSizeChange:o,variant:i="numbered",labels:s,pageSizeOptions:a=[10,20,50,100],showPageSizeSelector:l=!0,renderPageSizeSelectorDropdownItem:c=p=>p.label,renderPageSizeSelectorInputItem:u,className:f,itemClassName:d,activeItemClassName:h,pageSizeSelectorClassName:g})=>{const{prev:p="Previous",next:m="Next"}=s??{},v=S.useRef(null),[y,x]=S.useState(0),b=Math.ceil(n/t),w=e>0,_=e<b-1;S.useEffect(()=>{const $=v.current;if(!$)return;const H=new ResizeObserver(O=>{for(const P of O)x(P.contentRect.width)});return H.observe($),()=>{H.disconnect()}},[]);const R=($=>{if($<=0)return 1;const G=$-96;if(G<=40)return 1;const re=Math.floor((G+8)/48);return Math.max(1,Math.min(10,re))})(y),k=wO({page:e+1,count:b,maxVisiblePages:R}),M=()=>{w&&r(e-1)},F=()=>{_&&r(e+1)},D=$=>{o(Number($))};if(n===0)return null;const j=()=>C.jsxs(q,{ref:v,flex:1,row:!0,overflow:"hidden",gap:td.sm,children:[C.jsx(pr,{onClick:M,disabled:!w,color:"neutral",size:"sm",children:C.jsx(_0,{})}),C.jsx(q,{row:!0,gap:td.sm,children:k.map($=>C.jsx(E0,{isDots:$==="start-dots"||$==="end-dots",isCurrentPage:$===e+1,disabled:$==="start-dots"||$==="end-dots",onClick:()=>r($-1),className:d,activeClassName:h,children:$},$))}),C.jsx(pr,{color:"neutral",size:"sm",onClick:F,disabled:!_,children:C.jsx(T0,{})})]}),I=()=>C.jsxs(q,{flex:1,row:!0,gap:td.sm,alignItems:"center",className:f,children:[C.jsx(Br,{width:"auto",size:"sm",color:"neutral",iconLeft:C.jsx(_0,{width:20,height:20}),disabled:!w,onClick:M,children:p}),C.jsx(E0,{className:d,activeClassName:h,children:e+1}),C.jsx(Br,{width:"auto",size:"sm",color:"neutral",iconRight:C.jsx(T0,{width:20,height:20}),disabled:!_,onClick:F,children:m})]});return C.jsxs(q,{flex:1,row:!0,justifyContent:"space-between",children:[i==="simple"?I():j(),l&&C.jsx(q,{alignItems:"flex-end",className:g,children:C.jsx(Cg,{width:"fit-content",value:t.toString(),size:"sm",items:a.map($=>({value:$.toString(),label:$.toString()})),returnedValue:$=>$.value,renderDropdownItem:c,renderSingleInputItem:u,onChange:$=>D($)})})]})},E0=({children:e,isCurrentPage:t=!1,onClick:n,isDots:r=!1,disabled:o=!1,className:i,activeClassName:s})=>{const a=T.css({cursor:o?"not-allowed":"pointer",userSelect:"none",width:"40px",height:"40px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:t?si.fill.accentSecondary:si.fill.bgSecondary,borderRadius:CO.sm,border:t?`1px solid ${si.fill.accentSecondaryHover}`:`1px solid ${si.border.neutralAlphaBasic}`}),l=T.css({width:"24px",height:"24px",color:t?si.icon.secondary:si.icon.tertiary});return C.jsx(q,{className:T.cx(a,i,t&&s),onClick:o?void 0:n,children:r?C.jsx(bO,{className:l}):C.jsx(le,{center:!0,variant:"body-2",fontWeight:"medium",children:e})})},{color:Af,cornerRadius:_O}=V,TO=T.css({position:"relative",borderRadius:_O.md,overflow:"hidden","&::before, &::after":{content:'""',position:"absolute",top:0,bottom:14,width:96,pointerEvents:"none",zIndex:1,transition:"opacity 0.2s ease"},"&::before":{left:0,background:"linear-gradient(to left, rgba(255, 255, 255, 0.00) 0%, #FFF 100%)"},"&::after":{right:0,background:"linear-gradient(to right, rgba(255, 255, 255, 0.00) 0%, #FFF 100%)"}}),EO=T.css({overflowX:"auto",scrollbarWidth:"thin",scrollbarColor:`${Af.scrollbar.thumbPrimary} ${Af.scrollbar.trackPrimary}`}),gS=S.memo(({data:e,children:t,className:n,scrollContainerClassName:r,showBorders:o=!1,...i})=>{const[s,a]=S.useState(!1),[l,c]=S.useState(!1),u=S.useRef(null),f=S.useCallback(()=>{const h=u.current;if(!h)return;const{scrollLeft:g,scrollWidth:p,clientWidth:m}=h,v=p>m;a(v&&g>0),c(v&&g<p-m-1)},[]);S.useEffect(()=>{const h=u.current;if(!h)return;f();const g=new ResizeObserver(f);return g.observe(h),h.addEventListener("scroll",f),()=>{g.disconnect(),h.removeEventListener("scroll",f)}},[f,e]);const d=T.css({border:o?`1px solid ${Af.border.neutralAlphaLow}`:"transparent","&::before":{opacity:s?1:0},"&::after":{opacity:l?1:0}});return C.jsx(q,{className:T.cx(TO,d,n),...i,children:C.jsx(q,{ref:u,className:T.cx(EO,r),children:t})})});gS.displayName="TableWrapper";const{spacing:xn,cornerRadius:R0,color:Ys}=V,RO=T.css({width:"100%",maxWidth:"100%",minWidth:"max-content",borderCollapse:"collapse",borderSpacing:0,backgroundColor:Ys.fill.bgPrimary}),kO=T.css({backgroundColor:Ys.fill.bgSecondary,color:Ys.text.tertiary}),ns=({ref:e,data:t,columns:n,showBorders:r=!0,enableSorting:o=!1,enablePagination:i=!1,enableRowSelection:s=!1,enableMultiRowSelection:a=!1,sorting:l,onSortingChange:c,columnFilters:u,onColumnFiltersChange:f,columnVisibility:d,onColumnVisibilityChange:h,pagination:g,onPaginationChange:p,rowSelection:m,onRowSelectionChange:v,totalCount:y,loading:x=!1,emptyLabels:b={title:"Nothing found",description:"No results found for “result”",action:"Reset"},loadingLabels:w={title:"Loading...",description:"Please wait or reset your promt",action:"Reset"},className:_,containerClassName:E,theadClassName:R,tbodyClassName:k,emptyStateClassName:M,emptyStateTitleClassName:F,emptyStateDescriptionClassName:D,paginationClassName:j,tableOptions:I={},onRowClick:$,getRowId:H,headCellComponent:O=mO,bodyCellComponent:P=cS,headRowComponent:K=hS,bodyRowComponent:G=dS,onReset:re,paginationVariant:U,paginationLabels:Z,renderPageSizeSelectorDropdownItem:Q,renderPageSizeSelectorInputItem:ne})=>{const[oe,me]=S.useState([]),[ee,xe]=S.useState([]),[Se,Ee]=S.useState({}),[ze,je]=S.useState({pageIndex:0,pageSize:10}),[Rt,gn]=S.useState({}),ot=l??oe,Gt=u??ee,Qt=d??Se,pt=g??ze,se=m??Rt,Re=Ce=>{const Le=typeof Ce=="function"?Ce(ot):Ce;c?c(Le):me(Le)},Ye=Ce=>{const Le=typeof Ce=="function"?Ce(Gt):Ce;f?f(Le):xe(Le)},rt=Ce=>{const Le=typeof Ce=="function"?Ce(Qt):Ce;h?h(Le):Ee(Le)},It=Ce=>{const Le=typeof Ce=="function"?Ce(pt):Ce;p?p(Le):je(Le)},no=dO({data:t,columns:n,state:{sorting:ot,columnFilters:Gt,columnVisibility:Qt,pagination:pt,rowSelection:se},onSortingChange:Re,onColumnFiltersChange:Ye,onColumnVisibilityChange:rt,onPaginationChange:It,onRowSelectionChange:Ce=>{const Le=typeof Ce=="function"?Ce(se):Ce;v?v(Le):gn(Le)},getCoreRowModel:oO(),getSortedRowModel:o?aO():void 0,getPaginationRowModel:i?sO():void 0,enableRowSelection:s,enableMultiRowSelection:a,getRowId:H,manualPagination:!!y,pageCount:y?Math.ceil(y/pt.pageSize):void 0,...I});S.useImperativeHandle(e,()=>no);const{rows:pa}=no.getRowModel(),qo=(Ce,Le)=>{$&&$(Ce.original,Le)};return x?C.jsxs(q,{w:"full",borderRadius:R0.md,py:xn["5xl"],px:xn["10xl"],alignItems:"center",className:T.cx(E,M),children:[C.jsx(fO,{width:32,height:32,style:{color:Ys.icon.tertiary,marginBottom:xn.sm}}),C.jsx(le,{mb:xn.xs,variant:"title-3",fontWeight:"semibold",className:F,children:w.title}),C.jsx(le,{mb:xn.md,colorName:"tertiary",variant:"body-1",fontWeight:"medium",className:D,children:w.description}),typeof w.action=="string"?C.jsx(Br,{width:"auto",onClick:re,intensity:"secondary",color:"accent",children:w.action}):w.action]}):pa.length?C.jsxs(q,{w:"full",gap:xn.xl,className:T.cx(E),children:[C.jsx(gS,{data:t,showBorders:r,children:C.jsxs("table",{className:T.cx(RO,gO.table,_),children:[C.jsx("thead",{className:T.cx(kO,R),children:no.getHeaderGroups().map(Ce=>C.jsx(K,{showBorders:r,children:Ce.headers.map(Le=>C.jsx(O,{style:{width:Le.getSize()},onClick:Le.column.getToggleSortingHandler(),children:Le.isPlaceholder?null:b0(Le.column.columnDef.header,Le.getContext())},Le.id))},Ce.id))}),C.jsx("tbody",{className:k,children:pa.map((Ce,Le)=>C.jsx(G,{showBorders:r,isSelected:Ce.getIsSelected(),onClick:()=>qo(Ce,Le),children:Ce.getVisibleCells().map(Yo=>C.jsx(P,{children:b0(Yo.column.columnDef.cell,Yo.getContext())},Yo.id))},Ce.id))})]})}),i&&!x&&C.jsx(SO,{pageIndex:pt.pageIndex,pageSize:pt.pageSize,totalCount:y||t.length,variant:U,labels:Z,renderPageSizeSelectorDropdownItem:Q,renderPageSizeSelectorInputItem:ne,onPageChange:Ce=>It({...pt,pageIndex:Ce}),onPageSizeChange:Ce=>It({...pt,pageSize:Ce,pageIndex:0}),className:j})]}):C.jsxs(q,{w:"full",borderRadius:R0.md,py:xn["5xl"],px:xn["10xl"],alignItems:"center",className:T.cx(E,M),children:[C.jsx(hO,{width:24,height:24,style:{color:Ys.icon.tertiary,marginBottom:xn.sm}}),C.jsx(le,{mb:xn.xs,variant:"title-3",fontWeight:"semibold",className:F,children:b.title}),C.jsx(le,{mb:xn.md,colorName:"tertiary",variant:"body-1",fontWeight:"medium",className:D,children:b.description}),typeof b.action=="string"?C.jsx(Br,{width:"auto",onClick:re,intensity:"secondary",color:"accent",children:b.action}):b.action]})};ns.displayName="Table";ns.HeadCellContent=Eg;ns.BodyCellContent=uS;ns.HeadCellContentSortable=fS;ns.createColumnHelper=QC;const{color:rn}=V,nd={chart:{type:"areaspline",backgroundColor:"transparent",spacing:[0,0,0,0],margin:[0,0,0,0]},xAxis:{gridLineWidth:0,lineWidth:0,tickWidth:0,labels:{enabled:!1},title:{text:""}},yAxis:{gridLineWidth:0,lineWidth:0,tickWidth:0,labels:{enabled:!1},title:{text:""}},legend:{enabled:!1},credits:{enabled:!1}},AO={positive:{color:rn.fill.positivePrimary,fillColor:{linearGradient:{x1:0,y1:0,x2:0,y2:1},stops:[[0,rn.fill.positiveTintHigh],[1,rn.fill.positiveTransparent]]}},negative:{color:rn.fill.negativePrimary,fillColor:{linearGradient:{x1:0,y1:0,x2:0,y2:1},stops:[[0,rn.fill.negativeTintHigh],[1,rn.fill.negativeTransparent]]}},accent:{color:rn.fill.accentPrimary,fillColor:{linearGradient:{x1:0,y1:0,x2:0,y2:1},stops:[[0,rn.fill.accentTintHigh],[1,rn.fill.accentTransparent]]}},warning:{color:rn.fill.warningPrimary,fillColor:{linearGradient:{x1:0,y1:0,x2:0,y2:1},stops:[[0,rn.fill.warningTintHigh],[1,rn.fill.warningTransparent]]}},transfer:{color:"var(--fill-transfer-primary)",fillColor:{linearGradient:{x1:0,y1:0,x2:0,y2:1},stops:[[0,"var(--fill-transfer-tint-high)"],[1,"var(--fill-transfer-transparent)"]]}}},{color:k0}=V,NO=(e,t,n,r,o)=>({...nd,plotOptions:{areaspline:{marker:{enabled:!1,states:{hover:{enabled:o}}},allowPointSelect:!1}},xAxis:{...nd.xAxis,...n},yAxis:{...nd.yAxis,...r},series:[{type:"areaspline",data:t,...AO[e]}]}),MO=e=>({outside:!0,enabled:!!e,padding:0,position:{alignByTranslate:!0},shadow:{color:k0.effect.shadowM,offsetX:0,offsetY:0},borderRadius:8,backgroundColor:k0.fill.bgPrimary,useHTML:!0,...e}),pS=({color:e="positive",data:t=[],xAxis:n,yAxis:r,containerProps:o,highcharts:i,tooltip:s,className:a,style:l})=>{const c=S.useRef(null);S.useEffect(()=>()=>{typeof c=="object"&&c?.current?.chart&&c.current.chart.destroy()},[]);const u=S.useMemo(()=>NO(e,t,n,r,!!s),[e,t,n,r,s]),f=S.useMemo(()=>s?MO(s):{enabled:!1},[s]),d=S.useMemo(()=>({...o,className:T.cx(o?.className,a),style:{...o?.style,...l}}),[o,a,l]);return C.jsx(hl.Chart,{highcharts:i,ref:c,options:u,containerProps:d,children:C.jsx(hl.Tooltip,{...f})})};pS.displayName="LineChart";const{color:ir}=V,PO={chart:{type:"pie",backgroundColor:"transparent",spacing:[0,0,0,0],margin:[0,0,0,0],events:{click:void 0}},title:{align:"center",verticalAlign:"middle",floating:!0,style:{fontSize:"24px",fontWeight:"600",color:ir.text.primary}},plotOptions:{pie:{allowPointSelect:!0,cursor:"pointer",dataLabels:{enabled:!1},startAngle:90,endAngle:-90,innerSize:"90%",borderWidth:0,states:{hover:{enabled:!1},select:{enabled:!1},inactive:{enabled:!1}},enableMouseTracking:!1}},tooltip:{enabled:!1},legend:{enabled:!1},credits:{enabled:!1}},LO={positive:{colors:[ir.fill.positivePrimary,ir.fill.positiveTintHigh]},negative:{colors:[ir.fill.negativePrimary,ir.fill.negativeTintHigh]},accent:{colors:[ir.fill.accentPrimary,ir.fill.accentTintHigh]},warning:{colors:[ir.fill.warningPrimary,ir.fill.warningTintHigh]},transfer:{colors:["var(--fill-transfer-primary)","var(--fill-transfer-tint-high)"]}},FO=(e,t)=>({...PO,series:[{type:"pie",data:[{name:"",y:Math.min(e,100)},{name:"",y:Math.max(100-e,0)}],...LO[t]}]}),mS=S.forwardRef(({highcharts:e,color:t="positive",percentage:n,label:r=l=>`${l}%`,containerProps:o,className:i,style:s},a)=>{const l=S.useRef(null),c=a||l;S.useEffect(()=>()=>{typeof c=="object"&&c?.current?.chart&&c.current.chart.destroy()},[c]);const u=S.useMemo(()=>FO(n,t),[n,t]),f=S.useMemo(()=>({...o,className:T.cx(o?.className,i),style:{...o?.style,...s}}),[o,i,s]);return C.jsx(hl.Chart,{highcharts:e,ref:c,options:u,containerProps:f,children:C.jsx(hl.Title,{children:r?.(n)})})});mS.displayName="PieProgressChart";const $O=e=>N.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M9 17L14 12L9 7",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),{color:A0}=V,dl={link:T.css({...ye.body2,color:A0.text.tertiary,textDecoration:"none",transition:"color 0.2s ease","&:hover":{textDecoration:"underline"}}),separator:T.css({color:A0.icon.tertiary}),nav:T.css({display:"flex",alignItems:"center",flexWrap:"wrap"}),navItem:T.css({display:"inline-flex",alignItems:"center"})},Rg=({children:e,separator:t,className:n,itemClassName:r,separatorClassName:o})=>{const i=S.Children.toArray(e).filter(a=>S.isValidElement(a)),s=t??C.jsx($O,{className:T.cx(dl.separator,o)});return C.jsx("nav",{"aria-label":"breadcrumb",className:T.cx(dl.nav,n),children:i.map((a,l)=>{const c=l===i.length-1;return C.jsxs(le,{tag:"span",className:T.cx(dl.navItem,r),children:[S.cloneElement(a,{active:a.props.active??c}),!c&&s]},l)})})},OO=({children:e,href:t,active:n,className:r,activeClassName:o,activeElement:i,onClick:s})=>n?i||C.jsx(le,{tag:"span",variant:"body-2",fontWeight:"medium",colorName:"primary",className:T.cx(r,o),onClick:s,children:e}):C.jsx("a",{href:t,className:T.cx(dl.link,r),onClick:s,children:e});Rg.Item=OO;Rg.displayName="Breadcrumbs";const IO=Rg,{color:Qe,cornerRadius:Er,height:wt,transition:N0}=V,DO={primary:{bg:Qe.fill.accentTint,text:Qe.text.accent,icon:Qe.icon.accent},secondary:{bg:Qe.fill.neutralTint,text:Qe.text.secondary,icon:Qe.icon.tertiary},negative:{bg:Qe.fill.negativeTint,text:Qe.text.negative,icon:Qe.icon.negative},positive:{bg:Qe.fill.positiveTint,text:Qe.text.positive,icon:Qe.icon.positive},warning:{bg:Qe.fill.warningTint,text:Qe.text.warning,icon:Qe.icon.warning},neutral:{bg:Qe.fill.neutralTint,text:Qe.text.tertiary,icon:Qe.icon.tertiary},transfer:{bg:"var(--fill-transfer-tint)",text:"var(--text-transfer)",icon:"var(--icon-transfer)"},custom:{bg:Qe.fill.accentTint,text:Qe.text.accent,icon:Qe.icon.accent}},jO={"2xs":{size:wt.avatar["2xs"],borderRadius:Er.xs,iconSize:wt.icon["2xs"],fontSize:10,fontWeight:"var(--fw-medium)"},xs:{size:wt.avatar.xs,borderRadius:Er.sm,iconSize:wt.icon.xs,fontSize:12,fontWeight:"var(--fw-medium)"},sm:{size:wt.avatar.sm,borderRadius:Er.sm,iconSize:wt.icon.xs,fontSize:14,fontWeight:"var(--fw-medium)"},md:{size:wt.avatar.md,borderRadius:Er.sm,iconSize:wt.icon.sm,fontSize:14,fontWeight:"var(--fw-medium)"},lg:{size:wt.avatar.lg,borderRadius:Er.md,iconSize:wt.icon.md,fontSize:16,fontWeight:"var(--fw-semibold)"},xl:{size:wt.avatar.xl,borderRadius:Er.md,iconSize:wt.icon.md,fontSize:16,fontWeight:"var(--fw-semibold)"},"2xl":{size:wt.avatar["2xl"],borderRadius:Er.md,iconSize:wt.icon.md,fontSize:18,fontWeight:"var(--fw-semibold)"},custom:{size:wt.avatar.md,borderRadius:Er.sm,iconSize:wt.icon.sm,fontSize:14,fontWeight:"var(--fw-medium)"}},yS=S.forwardRef(({children:e,color:t="primary",size:n="md",fullRound:r=!1,className:o},i)=>{const s=S.useMemo(()=>DO[t],[t]),a=S.useMemo(()=>jO[n],[n]),l=S.useMemo(()=>T.css({width:a.size,height:a.size,borderRadius:r?"var(--corner-full-round)":a.borderRadius,backgroundColor:s.bg,color:s.text,fontSize:a.fontSize,fontWeight:a.fontWeight,lineHeight:1,transition:N0.general,"& svg":{width:a.iconSize,height:a.iconSize,color:s.icon,transition:N0.general},"& img":{width:"100%",height:"100%",objectFit:"cover"},"&:has(img)":{backgroundColor:"transparent",border:`1px solid ${Qe.border.neutralAlphaLow}`}}),[s,a,r]);return C.jsx(q,{ref:i,center:!0,overflow:"hidden",className:T.cx(l,o),children:e})});yS.displayName="Avatar";const{color:kt,cornerRadius:rd,spacing:fl}=V,Nf={neutral:{border:kt.border.neutralAlphaLow,bg:kt.status.neutralTint,color:kt.text.secondary,colorName:"secondary"},accent:{border:kt.border.accentSecondary,bg:kt.status.accentTintLow,color:kt.text.accent,colorName:"accent"},warning:{border:kt.border.warningSecondary,bg:kt.status.warningTintLow,color:kt.text.warning,colorName:"warning"},positive:{border:kt.border.positiveSecondary,bg:kt.status.positiveTintLow,color:kt.text.positive,colorName:"positive"},negative:{border:kt.border.negativeSecondary,bg:kt.status.negativeTintLow,color:kt.text.negative,colorName:"negative"},transfer:{border:"var(--border-transfer-secondary)",bg:"var(--status-transfer-tint-low)",color:"var(--text-transfer)",colorName:"transfer"}},Xa={sm:{h:24,text:"caption-1",corner:rd.xs,p:`6px ${fl.sm}`},md:{h:32,text:"body-2",corner:rd.sm,p:`6px ${fl.md}`},lg:{h:40,text:"body-2",corner:rd.md,p:`6px ${fl.lg}`}},VO=(e,t,n,r)=>{const o=Nf[t];let i=o.bg,s="none";const a=o.color;switch(e){case"outline":i="transparent",s=`1px solid ${o.border}`;break;case"clear":i="transparent";break;default:i=o.bg;break}return T.css({cursor:n?"not-allowed":r?"pointer":"default",opacity:n?.5:1,userSelect:"none",position:"relative",transition:"background-color 0.2s, opacity 0.2s",backgroundColor:i,color:a,border:s})},BO=T.css({display:"inline-flex",cursor:"pointer",opacity:.6,"&:hover":{opacity:1}}),vS=({label:e,color:t="neutral",size:n="md",variant:r="filled",leftElement:o,rightElement:i,disabled:s,onClick:a,onDelete:l,className:c,labelClassName:u,deleteButtonClassName:f})=>{const d=VO(r,t,s,a);return C.jsxs(q,{row:!0,alignItems:"center",gap:fl.sm,p:Xa[n].p,h:Xa[n].h,overflow:"hidden",borderRadius:Xa[n].corner,onClick:a,className:T.cx(d,c),children:[a&&C.jsx(zo,{}),o,C.jsx(le,{variant:Xa[n].text,colorName:Nf[t].colorName,textOverflow:"ellipsis",className:u,children:e}),i,l&&!s&&C.jsx(le,{className:T.cx(BO,f),colorName:Nf[t].colorName,onClick:h=>{h.stopPropagation(),l(h)},children:C.jsx(WC,{})})]})};vS.displayName="Badge";const zO=e=>N.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("circle",{cx:12,cy:12,r:10,fill:"currentColor",fillOpacity:.15}),N.createElement("path",{d:"M16 9L10.0337 15L8 12.9548",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),od=e=>N.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12Z",fill:"currentColor",fillOpacity:.15}),N.createElement("path",{d:"M12 6C11.4477 6 11 6.44772 11 7V13C11 13.5523 11.4477 14 12 14C12.5523 14 13 13.5523 13 13V7C13 6.44772 12.5523 6 12 6Z",fill:"currentColor"}),N.createElement("path",{d:"M12 15C11.4477 15 11 15.4477 11 16V17C11 17.5523 11.4477 18 12 18C12.5523 18 13 17.5523 13 17V16C13 15.4477 12.5523 15 12 15Z",fill:"currentColor"})),HO=e=>N.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("circle",{cx:12,cy:12,r:10,fill:"currentColor",fillOpacity:.12}),N.createElement("path",{d:"M16 8L8 16M16 16L8 8",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round"})),WO=e=>N.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:"currentColor",...e},N.createElement("path",{d:"M12 2V22M19.0711 4.92893L4.92893 19.0711M22 12H2M19.0711 19.0711L4.92893 4.92893",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),{color:Ke,cornerRadius:KO,spacing:Fs}=V,ai={hint:T.css({display:"flex",alignItems:"flex-start",gap:Fs.md,padding:Fs.lg,minHeight:48,width:"100%",borderRadius:KO.md,transition:"background 0.2s, color 0.2s"}),icon:T.css({flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center","& svg":{width:24,height:24}}),content:T.css({display:"flex",flexDirection:"column",gap:Fs.xs}),title:T.css({verticalAlign:"middle",color:"inherit"}),subtitle:T.css({verticalAlign:"middle",opacity:.8,color:"inherit"}),disabled:T.css({opacity:.5,pointerEvents:"none"})},UO={solid:{warning:T.css({background:Ke.status.warning,color:Ke.text.inverse}),negative:T.css({background:Ke.status.negative,color:Ke.text.inverse}),positive:T.css({background:Ke.status.positive,color:Ke.text.inverse}),accent:T.css({background:Ke.status.accent,color:Ke.text.inverse}),neutral:T.css({background:Ke.status.neutral,color:Ke.text.inverse}),transfer:T.css({background:Ke.status.transfer,color:Ke.text.inverse})},soft:{warning:T.css({background:Ke.status.warningTintLow,color:Ke.text.warning}),negative:T.css({background:Ke.status.negativeTintLow,color:Ke.text.negative}),positive:T.css({background:Ke.status.positiveTintLow,color:Ke.text.positive}),accent:T.css({background:Ke.status.accentTintLow,color:Ke.text.accent}),neutral:T.css({background:Ke.status.neutralTintLow,color:Ke.text.tertiary}),transfer:T.css({background:Ke.status.transferTintLow,color:Ke.text.transfer})}},GO={md:T.css({minHeight:48,padding:Fs.lg}),sm:T.css({minHeight:32,padding:Fs.md})},qO={negative:C.jsx(HO,{}),positive:C.jsx(zO,{}),accent:C.jsx(od,{}),warning:C.jsx(od,{}),transfer:C.jsx(od,{}),neutral:C.jsx(WO,{})},YO=({title:e,subtitle:t,color:n="warning",variant:r="soft",size:o="md",icon:i,disabled:s=!1,className:a,iconClassName:l,contentClassName:c,titleClassName:u,subtitleClassName:f,style:d})=>{const h=i||qO[n];return C.jsxs("div",{className:mo(ai.hint,GO[o],UO[r][n],s&&ai.disabled,a),style:d,"aria-disabled":s,children:[h&&C.jsx("span",{className:mo(ai.icon,l),children:h}),C.jsxs("div",{className:mo(ai.content,c),children:[e&&C.jsx(le,{className:mo(ai.title,u),variant:o==="md"?"body-1":"caption-2",children:e}),t&&C.jsx(le,{className:mo(ai.subtitle,f),variant:o==="md"?"body-2":"caption-1",children:t})]})]})},{color:co,cornerRadius:XO,spacing:On}=V,ZO=T.css({width:"100%",cursor:"default",userSelect:"text",outline:"none",...ye.body2,color:co.text.primary,overflowWrap:"anywhere","p, ul, ol, pre, blockquote, table":{margin:`${On.sm} 0`},"h1, h2, h3, h4, h5, h6":{margin:`${On.md} 0 ${On.sm}`,fontWeight:600},h1:{fontSize:ye.title1.fontSize,lineHeight:ye.title1.lineHeight},h2:{fontSize:ye.title2.fontSize,lineHeight:ye.title2.lineHeight},h3:{fontSize:ye.title3.fontSize,lineHeight:ye.title3.lineHeight},h4:{fontSize:ye.headline2.fontSize,lineHeight:ye.headline2.lineHeight},h5:{fontSize:ye.headline3.fontSize,lineHeight:ye.headline3.lineHeight},h6:{fontSize:ye.body1.fontSize,lineHeight:ye.body1.lineHeight},ul:{paddingLeft:On.xl,listStyleType:"disc"},ol:{paddingLeft:On.xl,listStyleType:"decimal"},li:{margin:`${On.xs} 0`},a:{color:co.text.accent,textDecoration:"underline"},code:{padding:`0 ${On.xs}`,borderRadius:XO.xs,backgroundColor:co.fill.neutralSecondary,fontFamily:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace'},"pre code":{display:"block",padding:On.md,overflowX:"auto"},blockquote:{marginLeft:0,paddingLeft:On.md,borderLeft:`3px solid ${co.border.neutralAlphaBasic}`,color:co.text.secondary},table:{width:"100%",borderCollapse:"collapse"},"th, td":{border:`1px solid ${co.border.neutralAlphaBasic}`,padding:On.sm,textAlign:"left"},th:{backgroundColor:co.fill.neutralSecondary}});function JO({markdown:e,className:t,emptyStateClassName:n,emptyState:r=null}){const o=e.trim(),i=S.useMemo(()=>({isEditable:!1,isPreviewMode:!0,setPreviewMode:()=>{},markdownText:o}),[o]);return o?C.jsx(gh.Provider,{value:i,children:C.jsx(Yw,{initialConfig:{...wC(),editable:!1,namespace:"ui-kit-markdown-text-viewer",editorState:()=>{Gw(o,zl)}},children:C.jsx(bC,{contentEditable:C.jsx(vC,{className:T.cx(ZO,t),"aria-placeholder":"markdown text",placeholder:()=>null}),placeholder:null,ErrorBoundary:xC})},o)}):typeof r=="string"?C.jsx(le,{variant:"body-2",colorName:"tertiary",className:n,children:r}):r}const{color:xS,cornerRadius:QO}=V,e5=T.keyframes`
86
86
  from {
87
87
  opacity: 0;
88
88
  }
89
89
  to {
90
90
  opacity: 1;
91
91
  }
92
- `,t5=R.css({animation:`${e5} 0.2s ease-out`,boxShadow:`0 4px 20px 0 ${gS.effect.shadowS}`}),n5=({children:e,className:t,...n})=>C.jsx(G,{relative:!0,backgroundColor:gS.fill.bgPrimary,borderRadius:QO.md,className:R.cx(t5,t),...n,children:e}),Lr=({children:e,content:t,initialOpen:n=!1,open:r,onChange:o,placement:i="bottom",trigger:s="click",offset:a=12,closeOnBackdropClick:l=!0,closeOnEsc:c=!0,className:u,contentClassName:f,style:d,openDelay:h=200,closeDelay:g=200,zIndex:p=1,popoverContentComponent:m=n5})=>{const[x,y]=S.useState(n),v=r??x,b=o??y,w=S.useCallback(()=>{l&&b(!1)},[l,b]),{context:_,refs:E,floatingStyles:T}=fg({placement:i,open:v,onOpenChange:b,whileElementsMounted:ig,middleware:[sg(a),lg({crossAxis:i.includes("-"),fallbackAxisSideDirection:i.includes("start")?"start":"end",padding:a}),ag({padding:a})]}),k=IF(_,{enabled:s==="click"}),P=$C(_,{enabled:s==="hover",delay:{open:h,close:g}}),O=OC(_,{escapeKey:c,outsidePress:!1}),D=DC(_),I=IC([k,P,O,D]),$=e.ref,H=LC([E.setReference,$]),U=S.cloneElement(e,I.getReferenceProps({...e.props,ref:H,"data-state":_.open?"open":"closed"}));return C.jsxs(C.Fragment,{children:[U,v&&C.jsxs(Gi,{children:[s!=="hover"&&l&&C.jsx(G,{position:"fixed",top:0,right:0,bottom:0,left:0,display:"block",backgroundColor:"transparent",onClick:w,zIndex:p}),C.jsx(G,{absolute:!0,zIndex:p,className:u,ref:E.setFloating,style:{...T,...d},...I.getFloatingProps(),children:C.jsx(m,{className:f,children:t})})]})]})},{color:r5,cornerRadius:kt,spacing:o5}=j,E0={xs:{width:16,height:16},sm:{width:24,height:24},md:{width:32,height:32},lg:{width:40,height:40},xl:{width:48,height:48}},i5={zero:kt.zero,xs:kt.xs,sm:kt.sm,md:kt.md,lg:kt.lg,xl:kt.xl,"2xl":kt["2xl"],"3xl":kt["3xl"],"4xl":kt["4xl"],"5xl":kt["5xl"],"6xl":kt["6xl"],"full-round":kt.fullRound,circular:"50%"},R0=R.css({backgroundColor:r5.status.neutralTint,borderRadius:kt.sm,position:"relative",overflow:"hidden","&::before":{content:'""',position:"absolute",top:0,left:0,right:0,bottom:0,background:"linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent)",transform:"translateX(-100%)"}}),s5=R.css({animation:"skeleton-pulse 1.5s ease-in-out infinite","@keyframes skeleton-pulse":{"0%":{opacity:1},"50%":{opacity:.4},"100%":{opacity:1}}}),a5=R.css({"&::before":{animation:"skeleton-wave 1.6s linear infinite"},"@keyframes skeleton-wave":{"0%":{transform:"translateX(-100%)"},"50%":{transform:"translateX(100%)"},"100%":{transform:"translateX(100%)"}}}),k0=(e,t)=>{if(t!==void 0)return R.css({borderRadius:i5[t]});switch(e){case"circular":return R.css({borderRadius:"50%"});case"text":return R.css({borderRadius:kt.xs});default:return R.css({borderRadius:kt.sm})}},A0=e=>{switch(e){case"pulse":return s5;case"wave":return a5;default:return""}},pS=({width:e,height:t,variant:n="rectangular",size:r="md",animation:o="wave",lines:i=1,className:s,children:a,loading:l=!0,borderRadius:c})=>{if(!l&&a)return C.jsx(C.Fragment,{children:a});if(!l)return null;const u=e||E0[r].width,f=t||E0[r].height;return n==="text"&&i>1?C.jsx(G,{gap:o5.sm,className:s,children:Array.from({length:i},(d,h)=>C.jsx(G,{className:R.cx(R0,k0(n,c),A0(o)),w:h===i-1?"70%":u,h:f},h))}):C.jsx(G,{className:R.cx(R0,k0(n,c),A0(o),s),w:u,h:f})};pS.displayName="Skeleton";const M0=e=>M.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("path",{d:"M11.9998 8.99999V13M11.9998 17H12.0098M10.6151 3.89171L2.39019 18.0983C1.93398 18.8863 1.70588 19.2803 1.73959 19.6037C1.769 19.8857 1.91677 20.142 2.14613 20.3088C2.40908 20.5 2.86435 20.5 3.77487 20.5H20.2246C21.1352 20.5 21.5904 20.5 21.8534 20.3088C22.0827 20.142 22.2305 19.8857 22.2599 19.6037C22.2936 19.2803 22.0655 18.8863 21.6093 18.0983L13.3844 3.89171C12.9299 3.10654 12.7026 2.71396 12.4061 2.58211C12.1474 2.4671 11.8521 2.4671 11.5935 2.58211C11.2969 2.71396 11.0696 3.10655 10.6151 3.89171Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),N0=e=>M.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("path",{d:"M7.5 12L10.5 15L16.5 9M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),l5=e=>M.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("path",{d:"M12 16V12M12 8H12.01M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),c5=e=>M.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("path",{d:"M17 7L7 17M7 7L17 17",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),u5={positive:C.jsx(N0,{}),negative:C.jsx(M0,{}),warning:C.jsx(M0,{}),info:C.jsx(l5,{}),neutral:C.jsx(N0,{})},d5=R.css({boxShadow:`0 4px 20px 0 ${j.color.effect.shadowM}`}),f5=R.css({cursor:"pointer","&:hover":{opacity:.8}}),mS=S.forwardRef(({title:e,subtitle:t,icon:n,variant:r="neutral",w:o="full",onClose:i,...s},a)=>{const l=S.useMemo(()=>r==="neutral"||r==="info"?j.color.icon.accent:r==="positive"?j.color.icon.positive:r==="negative"?j.color.icon.negative:r==="warning"?j.color.icon.warning:j.color.icon.inverse,[r]),c=S.useMemo(()=>r==="neutral"?j.color.icon.tertiary:j.color.icon.inverse,[r]),u=S.useMemo(()=>r==="neutral"?j.color.fill.accentSecondary:j.color.fill.bgPrimary,[r]),f=S.useMemo(()=>r==="neutral"?j.color.fill.bgPrimary:r==="info"?j.color.fill.accentPrimary:r==="positive"?j.color.fill.positivePrimary:r==="negative"?j.color.fill.negativePrimary:r==="warning"?j.color.fill.warningPrimary:j.color.fill.accentPrimary,[r]),d=S.useMemo(()=>r==="neutral"?j.color.text.primary:j.color.text.primaryInverse,[r]),h=S.useMemo(()=>r==="neutral"?j.color.text.tertiaryInverse:j.color.text.primaryInverse,[r]);return C.jsxs(G,{row:!0,w:o,ref:a,p:j.spacing.md,gap:j.spacing.md,backgroundColor:f,borderRadius:j.cornerRadius.lg,className:d5,...s,children:[C.jsx(G,{w:48,h:48,center:!0,backgroundColor:u,borderRadius:j.cornerRadius.md,style:{color:l},children:n||u5[r]}),C.jsxs(G,{flex:1,children:[C.jsx(se,{variant:"body-1",fontWeight:"semibold",color:d,children:e}),t&&C.jsx(se,{variant:"body-2",fontWeight:"medium",color:h,children:t})]}),C.jsx(G,{onClick:i,children:C.jsx(c5,{width:24,height:24,color:c,className:f5})})]})});let Qo=[];const Cf=new Set,cs=new Map;function Xu(){for(const e of Cf)e()}function h5(){return Math.random().toString(36).slice(2,9)}const wn={getSnapshot(){return Qo},subscribe(e){return Cf.add(e),()=>Cf.delete(e)},add(e){const t=e.id??h5(),n=e.duration??5e3;if(Qo=[...Qo,{...e,id:t,duration:n}],Xu(),n>0){const r=setTimeout(()=>wn.remove(t),n);cs.set(t,r)}return t},remove(e){const t=cs.get(e);t&&(clearTimeout(t),cs.delete(e)),Qo=Qo.filter(n=>n.id!==e),Xu()},removeAll(){for(const[,e]of cs)clearTimeout(e);cs.clear(),Qo=[],Xu()}};class g5{show(t){return wn.add(t)}dismiss(t){wn.remove(t)}dismissAll(){wn.removeAll()}success(t,n){return this.show({...n,title:t,variant:"positive"})}error(t,n){return this.show({...n,title:t,variant:"negative"})}warning(t,n){return this.show({...n,title:t,variant:"warning"})}info(t,n){return this.show({...n,title:t,variant:"info"})}}const Tr=new g5;function p5(){return{toasts:S.useSyncExternalStore(wn.subscribe,wn.getSnapshot,wn.getSnapshot),show:Tr.show,success:Tr.success,error:Tr.error,warning:Tr.warning,info:Tr.info,dismiss:Tr.dismiss,dismissAll:Tr.dismissAll}}const m5={"top-left":{top:16,left:16,alignItems:"flex-start"},"top-center":{top:16,left:"50%",transform:"translateX(-50%)",alignItems:"center"},"top-right":{top:16,right:16,alignItems:"flex-end"},"bottom-left":{bottom:16,left:16,alignItems:"flex-start"},"bottom-center":{bottom:16,left:"50%",transform:"translateX(-50%)",alignItems:"center"},"bottom-right":{bottom:16,right:16,alignItems:"flex-end"}},y5=e=>{const t=e.startsWith("top"),n=e.endsWith("left"),r=e.endsWith("right"),o=e.endsWith("center"),i=n?-40:r?40:0;return{initial:{opacity:0,x:i,y:t?-16:16,scale:.95},animate:{opacity:1,x:0,y:0,scale:1},exit:{opacity:0,x:i,scale:.95,transition:{duration:.15}}}},v5=R.css({position:"fixed",zIndex:2,display:"flex",flexDirection:"column",gap:8,pointerEvents:"none",maxWidth:325,width:"100%"}),x5=R.css({pointerEvents:"auto",width:"100%"});function yS({position:e="top-right"}){const t=S.useSyncExternalStore(wn.subscribe,wn.getSnapshot,wn.getSnapshot),n=y5(e);return C.jsx(Gi,{children:C.jsx("div",{className:v5,style:m5[e],children:C.jsx(Lx,{initial:!1,children:t.map(r=>C.jsx(Us.div,{className:x5,layout:!0,initial:n.initial,animate:n.animate,exit:n.exit,transition:{type:"spring",stiffness:400,damping:30},children:C.jsx(mS,{title:r.title,subtitle:r.subtitle,icon:r.icon,variant:r.variant,onClose:()=>wn.remove(r.id)})},r.id))})})})}const{color:Ha}=j,b5={top:"polygon(100% 0%, 50% 100%, 0% 0%)",bottom:"polygon(0% 100%, 50% 0%, 100% 100%)","top-start":"polygon(0% 0%, 0% 100%, 100% 0%)","top-end":"polygon(100% 0%, 100% 100%, 0% 0%)","bottom-start":"polygon(0% 100%, 0% 0%, 100% 100%)","bottom-end":"polygon(100% 100%, 100% 0%, 0% 100%)",left:"polygon(0% 100%, 100% 50%, 0% 0%)",right:"polygon(100% 100%, 0% 50%, 100% 0%)"},w5=10,C5=6,Wa=1,P0={primary:{backgroundColor:Ha.fill.bgPrimary,color:Ha.text.primary},inverse:{backgroundColor:Ha.fill.bgPrimaryInverse,color:Ha.text.primaryInverse}},S5=(e,t)=>(e==="top"||e==="bottom")&&t?`${e}-${t}`:e,_5=(e,t,n)=>n?(e==="top"||e==="bottom")&&t?{[e==="top"?t==="start"?"borderBottomLeftRadius":"borderBottomRightRadius":t==="start"?"borderTopLeftRadius":"borderTopRightRadius"]:0}:{}:{},T5=(e,t,n)=>e==="left"||e==="right"?{width:6,height:n}:t?{width:8,height:6}:{width:n,height:6},E5=(e,t,n)=>e?(t==="top"||t==="bottom")&&n?{x:n==="start"?0:void 0,y:e.y}:{x:e.x,y:e.y}:{x:void 0,y:void 0},{color:R5,cornerRadius:k5,spacing:A5}=j,M5=R.keyframes`
92
+ `,t5=T.css({animation:`${e5} 0.2s ease-out`,boxShadow:`0 4px 20px 0 ${xS.effect.shadowS}`}),n5=({children:e,className:t,...n})=>C.jsx(q,{relative:!0,backgroundColor:xS.fill.bgPrimary,borderRadius:QO.md,className:T.cx(t5,t),...n,children:e}),Or=({children:e,content:t,initialOpen:n=!1,open:r,onChange:o,placement:i="bottom",trigger:s="click",offset:a=12,closeOnBackdropClick:l=!0,closeOnEsc:c=!0,className:u,contentClassName:f,backdropClassName:d,style:h,openDelay:g=200,closeDelay:p=200,zIndex:m=1,popoverContentComponent:v=n5})=>{const[y,x]=S.useState(n),b=r??y,w=o??x,_=S.useCallback(()=>{l&&w(!1)},[l,w]),{context:E,refs:R,floatingStyles:k}=bg({placement:i,open:b,onOpenChange:w,whileElementsMounted:hg,middleware:[gg(a),mg({crossAxis:i.includes("-"),fallbackAxisSideDirection:i.includes("start")?"start":"end",padding:a}),pg({padding:a})]}),M=VF(E,{enabled:s==="click"}),F=VC(E,{enabled:s==="hover",delay:{open:g,close:p}}),D=BC(E,{escapeKey:c,outsidePress:!1}),j=HC(E),I=zC([M,F,D,j]),$=e.ref,H=DC([R.setReference,$]),O=S.cloneElement(e,I.getReferenceProps({...e.props,ref:H,"data-state":E.open?"open":"closed"}));return C.jsxs(C.Fragment,{children:[O,b&&C.jsxs(ts,{children:[s!=="hover"&&l&&C.jsx(q,{position:"fixed",top:0,right:0,bottom:0,left:0,display:"block",backgroundColor:"transparent",onClick:_,zIndex:m,className:d}),C.jsx(q,{absolute:!0,zIndex:m,className:u,ref:R.setFloating,style:{...k,...h},...I.getFloatingProps(),children:C.jsx(v,{className:f,children:t})})]})]})},{color:r5,cornerRadius:Mt,spacing:o5}=V,M0={xs:{width:16,height:16},sm:{width:24,height:24},md:{width:32,height:32},lg:{width:40,height:40},xl:{width:48,height:48}},i5={zero:Mt.zero,xs:Mt.xs,sm:Mt.sm,md:Mt.md,lg:Mt.lg,xl:Mt.xl,"2xl":Mt["2xl"],"3xl":Mt["3xl"],"4xl":Mt["4xl"],"5xl":Mt["5xl"],"6xl":Mt["6xl"],"full-round":Mt.fullRound,circular:"50%"},P0=T.css({backgroundColor:r5.status.neutralTint,borderRadius:Mt.sm,position:"relative",overflow:"hidden","&::before":{content:'""',position:"absolute",top:0,left:0,right:0,bottom:0,background:"linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent)",transform:"translateX(-100%)"}}),s5=T.css({animation:"skeleton-pulse 1.5s ease-in-out infinite","@keyframes skeleton-pulse":{"0%":{opacity:1},"50%":{opacity:.4},"100%":{opacity:1}}}),a5=T.css({"&::before":{animation:"skeleton-wave 1.6s linear infinite"},"@keyframes skeleton-wave":{"0%":{transform:"translateX(-100%)"},"50%":{transform:"translateX(100%)"},"100%":{transform:"translateX(100%)"}}}),L0=(e,t)=>{if(t!==void 0)return T.css({borderRadius:i5[t]});switch(e){case"circular":return T.css({borderRadius:"50%"});case"text":return T.css({borderRadius:Mt.xs});default:return T.css({borderRadius:Mt.sm})}},F0=e=>{switch(e){case"pulse":return s5;case"wave":return a5;default:return""}},bS=({width:e,height:t,variant:n="rectangular",size:r="md",animation:o="wave",lines:i=1,className:s,lineClassName:a,children:l,loading:c=!0,borderRadius:u})=>{if(!c&&l)return C.jsx(C.Fragment,{children:l});if(!c)return null;const f=e||M0[r].width,d=t||M0[r].height;return n==="text"&&i>1?C.jsx(q,{gap:o5.sm,className:s,children:Array.from({length:i},(h,g)=>C.jsx(q,{className:T.cx(P0,L0(n,u),F0(o),a),w:g===i-1?"70%":f,h:d},g))}):C.jsx(q,{className:T.cx(P0,L0(n,u),F0(o),s),w:f,h:d})};bS.displayName="Skeleton";const $0=e=>N.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M11.9998 8.99999V13M11.9998 17H12.0098M10.6151 3.89171L2.39019 18.0983C1.93398 18.8863 1.70588 19.2803 1.73959 19.6037C1.769 19.8857 1.91677 20.142 2.14613 20.3088C2.40908 20.5 2.86435 20.5 3.77487 20.5H20.2246C21.1352 20.5 21.5904 20.5 21.8534 20.3088C22.0827 20.142 22.2305 19.8857 22.2599 19.6037C22.2936 19.2803 22.0655 18.8863 21.6093 18.0983L13.3844 3.89171C12.9299 3.10654 12.7026 2.71396 12.4061 2.58211C12.1474 2.4671 11.8521 2.4671 11.5935 2.58211C11.2969 2.71396 11.0696 3.10655 10.6151 3.89171Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),O0=e=>N.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M7.5 12L10.5 15L16.5 9M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),l5=e=>N.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M12 16V12M12 8H12.01M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),c5=e=>N.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M17 7L7 17M7 7L17 17",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),u5={positive:C.jsx(O0,{}),negative:C.jsx($0,{}),warning:C.jsx($0,{}),info:C.jsx(l5,{}),neutral:C.jsx(O0,{})},d5=T.css({boxShadow:`0 4px 20px 0 ${V.color.effect.shadowM}`}),f5=T.css({cursor:"pointer","&:hover":{opacity:.8}}),wS=S.forwardRef(({title:e,subtitle:t,icon:n,variant:r="neutral",w:o="full",onClose:i,className:s,iconBoxClassName:a,titleClassName:l,subtitleClassName:c,closeIconClassName:u,...f},d)=>{const h=S.useMemo(()=>r==="neutral"||r==="info"?V.color.icon.accent:r==="positive"?V.color.icon.positive:r==="negative"?V.color.icon.negative:r==="warning"?V.color.icon.warning:V.color.icon.inverse,[r]),g=S.useMemo(()=>r==="neutral"?V.color.icon.tertiary:V.color.icon.inverse,[r]),p=S.useMemo(()=>r==="neutral"?V.color.fill.accentSecondary:V.color.fill.bgPrimary,[r]),m=S.useMemo(()=>r==="neutral"?V.color.fill.bgPrimary:r==="info"?V.color.fill.accentPrimary:r==="positive"?V.color.fill.positivePrimary:r==="negative"?V.color.fill.negativePrimary:r==="warning"?V.color.fill.warningPrimary:V.color.fill.accentPrimary,[r]),v=S.useMemo(()=>r==="neutral"?V.color.text.primary:V.color.text.primaryInverse,[r]),y=S.useMemo(()=>r==="neutral"?V.color.text.tertiaryInverse:V.color.text.primaryInverse,[r]);return C.jsxs(q,{row:!0,w:o,ref:d,p:V.spacing.md,gap:V.spacing.md,backgroundColor:m,borderRadius:V.cornerRadius.lg,className:T.cx(d5,s),...f,children:[C.jsx(q,{w:48,h:48,center:!0,backgroundColor:p,borderRadius:V.cornerRadius.md,style:{color:h},className:a,children:n||u5[r]}),C.jsxs(q,{flex:1,children:[C.jsx(le,{variant:"body-1",fontWeight:"semibold",color:v,className:l,children:e}),t&&C.jsx(le,{variant:"body-2",fontWeight:"medium",color:y,className:c,children:t})]}),C.jsx(q,{onClick:i,children:C.jsx(c5,{width:24,height:24,color:g,className:T.cx(f5,u)})})]})});let li=[];const Mf=new Set,ys=new Map;function id(){for(const e of Mf)e()}function h5(){return Math.random().toString(36).slice(2,9)}const _n={getSnapshot(){return li},subscribe(e){return Mf.add(e),()=>Mf.delete(e)},add(e){const t=e.id??h5(),n=e.duration??5e3;if(li=[...li,{...e,id:t,duration:n}],id(),n>0){const r=setTimeout(()=>_n.remove(t),n);ys.set(t,r)}return t},remove(e){const t=ys.get(e);t&&(clearTimeout(t),ys.delete(e)),li=li.filter(n=>n.id!==e),id()},removeAll(){for(const[,e]of ys)clearTimeout(e);ys.clear(),li=[],id()}};class g5{show(t){return _n.add(t)}dismiss(t){_n.remove(t)}dismissAll(){_n.removeAll()}success(t,n){return this.show({...n,title:t,variant:"positive"})}error(t,n){return this.show({...n,title:t,variant:"negative"})}warning(t,n){return this.show({...n,title:t,variant:"warning"})}info(t,n){return this.show({...n,title:t,variant:"info"})}}const kr=new g5;function p5(){return{toasts:S.useSyncExternalStore(_n.subscribe,_n.getSnapshot,_n.getSnapshot),show:kr.show,success:kr.success,error:kr.error,warning:kr.warning,info:kr.info,dismiss:kr.dismiss,dismissAll:kr.dismissAll}}const m5={"top-left":{top:16,left:16,alignItems:"flex-start"},"top-center":{top:16,left:"50%",transform:"translateX(-50%)",alignItems:"center"},"top-right":{top:16,right:16,alignItems:"flex-end"},"bottom-left":{bottom:16,left:16,alignItems:"flex-start"},"bottom-center":{bottom:16,left:"50%",transform:"translateX(-50%)",alignItems:"center"},"bottom-right":{bottom:16,right:16,alignItems:"flex-end"}},y5=e=>{const t=e.startsWith("top"),n=e.endsWith("left"),r=e.endsWith("right"),o=e.endsWith("center"),i=n?-40:r?40:0;return{initial:{opacity:0,x:i,y:t?-16:16,scale:.95},animate:{opacity:1,x:0,y:0,scale:1},exit:{opacity:0,x:i,scale:.95,transition:{duration:.15}}}},v5=T.css({position:"fixed",zIndex:2,display:"flex",flexDirection:"column",gap:8,pointerEvents:"none",maxWidth:325,width:"100%"}),x5=T.css({pointerEvents:"auto",width:"100%"});function CS({position:e="top-right",className:t,itemClassName:n,toastClassName:r}){const o=S.useSyncExternalStore(_n.subscribe,_n.getSnapshot,_n.getSnapshot),i=y5(e);return C.jsx(ts,{children:C.jsx("div",{className:T.cx(v5,t),style:m5[e],children:C.jsx(Dx,{initial:!1,children:o.map(s=>C.jsx(ea.div,{className:T.cx(x5,n),layout:!0,initial:i.initial,animate:i.animate,exit:i.exit,transition:{type:"spring",stiffness:400,damping:30},children:C.jsx(wS,{title:s.title,subtitle:s.subtitle,icon:s.icon,variant:s.variant,onClose:()=>_n.remove(s.id),className:r})},s.id))})})})}const{color:Za}=V,b5={top:"polygon(100% 0%, 50% 100%, 0% 0%)",bottom:"polygon(0% 100%, 50% 0%, 100% 100%)","top-start":"polygon(0% 0%, 0% 100%, 100% 0%)","top-end":"polygon(100% 0%, 100% 100%, 0% 0%)","bottom-start":"polygon(0% 100%, 0% 0%, 100% 100%)","bottom-end":"polygon(100% 100%, 100% 0%, 0% 100%)",left:"polygon(0% 100%, 100% 50%, 0% 0%)",right:"polygon(100% 100%, 0% 50%, 100% 0%)"},w5=10,C5=6,Ja=1,I0={primary:{backgroundColor:Za.fill.bgPrimary,color:Za.text.primary},inverse:{backgroundColor:Za.fill.bgPrimaryInverse,color:Za.text.primaryInverse}},S5=(e,t)=>(e==="top"||e==="bottom")&&t?`${e}-${t}`:e,_5=(e,t,n)=>n?(e==="top"||e==="bottom")&&t?{[e==="top"?t==="start"?"borderBottomLeftRadius":"borderBottomRightRadius":t==="start"?"borderTopLeftRadius":"borderTopRightRadius"]:0}:{}:{},T5=(e,t,n)=>e==="left"||e==="right"?{width:6,height:n}:t?{width:8,height:6}:{width:n,height:6},E5=(e,t,n)=>e?(t==="top"||t==="bottom")&&n?{x:n==="start"?0:void 0,y:e.y}:{x:e.x,y:e.y}:{x:void 0,y:void 0},{color:R5,cornerRadius:k5,spacing:A5}=V,N5=T.keyframes`
93
93
  from { opacity: 0; transform: translateY(2px); }
94
94
  to { opacity: 1; transform: translateY(0); }
95
- `,N5=R.css({boxShadow:`0 4px 20px 0 ${R5.effect.shadowM}`,animation:`${M5} 0.16s ease-out`,fontSize:"12px",lineHeight:"16px",fontWeight:"500",wordBreak:"break-word"}),P5=R.css({position:"absolute",clipPath:"var(--tooltip-arrow-shape)"}),vS=({color:e="primary",children:t,content:n,disabled:r=!1,initialOpen:o=!1,open:i,onChange:s,placement:a="top",trigger:l="hover",offset:c=5,showArrow:u=!0,openDelay:f=400,closeDelay:d=0,closeOnEsc:h=!0,zIndex:g=1,maxWidth:p,className:m,contentClassName:x,style:y,id:v,p:b=A5.md,borderRadius:w=k5.sm})=>{const[_,E]=S.useState(o),[T,k]=S.useState(null),P=i??_,O=s??E,D=S.useId(),I=v??`tooltip-${D}`,$=n==null||n==="",H=!r&&!$,U=S.useCallback(Xt=>{H&&O(Xt)},[H,O]),L=c+(u?C5:0),{context:N,refs:V,floatingStyles:K,middlewareData:te,placement:J}=fg({placement:a,open:H?P:!1,onOpenChange:U,whileElementsMounted:ig,middleware:[sg(L),lg({crossAxis:a.includes("-"),fallbackAxisSideDirection:a.includes("start")?"start":"end",padding:L}),ag({padding:L}),...u&&T?[EF({element:T,padding:0})]:[]]}),Z=te.arrow,ae=J.split("-")[0],oe=J.includes("-")?J.split("-")[1]:null,fe=E5(Z,ae,oe),Te=S5(ae,oe),ne=_5(ae,oe,u),ve=T5(ae,oe,w5),Ee=R.css({...ne,...P0[e]}),De=R.css({left:fe.x??void 0,top:fe.y??void 0,width:ve.width,height:ve.height,"--tooltip-arrow-shape":b5[Te],...ae==="top"&&{bottom:-ve.height+Wa},...ae==="bottom"&&{top:-ve.height+Wa},...ae==="left"&&{right:-ve.width+Wa},...ae==="right"&&{left:-ve.width+Wa},...oe==="end"&&(ae==="top"||ae==="bottom")&&{left:"auto",right:0},...P0[e]}),st=$C(N,{enabled:l==="hover"&&H,delay:{open:f,close:d},move:!1}),ee=BF(N,{enabled:l==="hover"&&H}),Ce=OC(N,{enabled:h&&H,escapeKey:!0}),ze=DC(N,{role:"tooltip"}),Re=IC([st,ee,Ce,ze]),mt=t.ref,Ft=LC([V.setReference,mt]),Yt=S.useMemo(()=>S.cloneElement(t,Re.getReferenceProps({...t.props,ref:Ft,"data-state":N.open?"open":"closed",...N.open?{"aria-describedby":I}:{}})),[t,Re,N.open,I,Ft]);return C.jsxs(C.Fragment,{children:[Yt,H&&P&&C.jsx(Gi,{children:C.jsx(G,{absolute:!0,zIndex:g,className:m,ref:V.setFloating,style:{...K,...y},...Re.getFloatingProps({id:I}),children:C.jsxs(G,{relative:!0,maxWidth:p,p:b,borderRadius:w,className:R.cx(N5,Ee,x),children:[u&&C.jsx(G,{ref:k,className:R.cx(P5,De)}),typeof n=="string"?C.jsx(se,{colorName:e,variant:"caption-1",fontWeight:"medium",children:n}):n]})})})]})};vS.displayName="Tooltip";const L5="_themeProviderScoped_8xy1z_9",F5={themeProviderScoped:L5};function $5({className:e,children:t,theme:n,position:r="top-right"}){const o=S.useRef(null);return C.jsx(GC.Provider,{value:o,children:C.jsxs("div",{ref:o,className:Tf(F5.themeProviderScoped,e),id:"theme-provider-scoped","data-theme":n,children:[t,C.jsx(yS,{position:r})]})})}exports.AnimatedText=b1;exports.Avatar=fS;exports.Badge=hS;exports.Box=G;exports.Breadcrumbs=IO;exports.Breakpoints=Er;exports.BreakpointsBase=lo;exports.Button=Ti;exports.Checkbox=ih;exports.Hint=YO;exports.IconButton=fr;exports.Input=Ei;exports.LineChart=uS;exports.Loader=$0;exports.MARKDOWN_TEXT_EDITOR_LOCALE_KEY=S1;exports.MarkdownText=JO;exports.MarkdownTextEditor=iL;exports.MarkdownToolbarAction=ie;exports.Modal=pc;exports.OtpInput=yC;exports.PieProgressChart=dS;exports.Popover=Lr;exports.Portal=Gi;exports.Radio=xC;exports.RadioGroup=bC;exports.Ripple=$o;exports.SegmentControl=dL;exports.Select=gg;exports.Skeleton=pS;exports.Switch=BC;exports.Table=qi;exports.Tabs=HC;exports.Tag=hg;exports.Text=se;exports.ThemeProviderScoped=$5;exports.Toast=mS;exports.ToastContainer=yS;exports.Tooltip=vS;exports.UiKitLocaleProvider=n3;exports.createColumnHelper=qC;exports.getFontWeightClass=A_;exports.getSizeClass=M_;exports.getStyleClass=Sf;exports.theme=j;exports.toast=Tr;exports.useBreakpoint=k_;exports.useControlled=Fo;exports.useToast=p5;
95
+ `,M5=T.css({boxShadow:`0 4px 20px 0 ${R5.effect.shadowM}`,animation:`${N5} 0.16s ease-out`,fontSize:"12px",lineHeight:"16px",fontWeight:"500",wordBreak:"break-word"}),P5=T.css({position:"absolute",clipPath:"var(--tooltip-arrow-shape)"}),SS=({color:e="primary",children:t,content:n,disabled:r=!1,initialOpen:o=!1,open:i,onChange:s,placement:a="top",trigger:l="hover",offset:c=5,showArrow:u=!0,openDelay:f=400,closeDelay:d=0,closeOnEsc:h=!0,zIndex:g=1,maxWidth:p,className:m,contentClassName:v,arrowClassName:y,textClassName:x,style:b,id:w,p:_=A5.md,borderRadius:E=k5.sm})=>{const[R,k]=S.useState(o),[M,F]=S.useState(null),D=i??R,j=s??k,I=S.useId(),$=w??`tooltip-${I}`,H=n==null||n==="",O=!r&&!H,P=S.useCallback(Ye=>{O&&j(Ye)},[O,j]),K=c+(u?C5:0),{context:G,refs:re,floatingStyles:U,middlewareData:Z,placement:Q}=bg({placement:a,open:O?D:!1,onOpenChange:P,whileElementsMounted:hg,middleware:[gg(K),mg({crossAxis:a.includes("-"),fallbackAxisSideDirection:a.includes("start")?"start":"end",padding:K}),pg({padding:K}),...u&&M?[AF({element:M,padding:0})]:[]]}),ne=Z.arrow,oe=Q.split("-")[0],me=Q.includes("-")?Q.split("-")[1]:null,ee=E5(ne,oe,me),xe=S5(oe,me),Se=_5(oe,me,u),Ee=T5(oe,me,w5),ze=T.css({...Se,...I0[e]}),je=T.css({left:ee.x??void 0,top:ee.y??void 0,width:Ee.width,height:Ee.height,"--tooltip-arrow-shape":b5[xe],...oe==="top"&&{bottom:-Ee.height+Ja},...oe==="bottom"&&{top:-Ee.height+Ja},...oe==="left"&&{right:-Ee.width+Ja},...oe==="right"&&{left:-Ee.width+Ja},...me==="end"&&(oe==="top"||oe==="bottom")&&{left:"auto",right:0},...I0[e]}),Rt=VC(G,{enabled:l==="hover"&&O,delay:{open:f,close:d},move:!1}),gn=WF(G,{enabled:l==="hover"&&O}),ot=BC(G,{enabled:h&&O,escapeKey:!0}),Gt=HC(G,{role:"tooltip"}),Qt=zC([Rt,gn,ot,Gt]),pt=t.ref,se=DC([re.setReference,pt]),Re=S.useMemo(()=>S.cloneElement(t,Qt.getReferenceProps({...t.props,ref:se,"data-state":G.open?"open":"closed",...G.open?{"aria-describedby":$}:{}})),[t,Qt,G.open,$,se]);return C.jsxs(C.Fragment,{children:[Re,O&&D&&C.jsx(ts,{children:C.jsx(q,{absolute:!0,zIndex:g,className:m,ref:re.setFloating,style:{...U,...b},...Qt.getFloatingProps({id:$}),children:C.jsxs(q,{relative:!0,maxWidth:p,p:_,borderRadius:E,className:T.cx(M5,ze,v),children:[u&&C.jsx(q,{ref:F,className:T.cx(P5,je,y)}),typeof n=="string"?C.jsx(le,{colorName:e,variant:"caption-1",fontWeight:"medium",className:x,children:n}):n]})})})]})};SS.displayName="Tooltip";const L5="_themeProviderScoped_8xy1z_9",F5={themeProviderScoped:L5};function $5({className:e,children:t,theme:n,position:r="top-right"}){const o=S.useRef(null);return C.jsx(JC.Provider,{value:o,children:C.jsxs("div",{ref:o,className:mo(F5.themeProviderScoped,e),id:"theme-provider-scoped","data-theme":n,children:[t,C.jsx(CS,{position:r})]})})}exports.AnimatedText=Tb;exports.Avatar=yS;exports.Badge=vS;exports.Box=q;exports.Breadcrumbs=IO;exports.Breakpoints=Ar;exports.BreakpointsBase=po;exports.Button=Br;exports.Checkbox=hh;exports.Hint=YO;exports.IconButton=pr;exports.Input=Fi;exports.LineChart=pS;exports.Loader=V0;exports.MARKDOWN_TEXT_EDITOR_LOCALE_KEY=kb;exports.MarkdownText=JO;exports.MarkdownTextEditor=lL;exports.MarkdownToolbarAction=ae;exports.Modal=Sc;exports.OtpInput=CC;exports.PieProgressChart=mS;exports.Popover=Or;exports.Portal=ts;exports.Radio=_C;exports.RadioGroup=TC;exports.Ripple=zo;exports.SegmentControl=gL;exports.Select=Cg;exports.Skeleton=bS;exports.Switch=UC;exports.Table=ns;exports.Tabs=qC;exports.Tag=wg;exports.Text=le;exports.ThemeProviderScoped=$5;exports.Toast=wS;exports.ToastContainer=CS;exports.Tooltip=SS;exports.UiKitLocaleProvider=i3;exports.createColumnHelper=QC;exports.getFontWeightClass=P_;exports.getSizeClass=L_;exports.getStyleClass=Pf;exports.theme=V;exports.toast=kr;exports.useBreakpoint=M_;exports.useControlled=Bo;exports.useToast=p5;
96
96
  //# sourceMappingURL=ui-kit.cjs.js.map